sgrebnov commented on code in PR #11494:
URL: https://github.com/apache/datafusion/pull/11494#discussion_r1680208153
##########
datafusion/sql/src/unparser/dialect.rs:
##########
@@ -45,6 +45,13 @@ pub trait Dialect {
fn interval_style(&self) -> IntervalStyle {
IntervalStyle::PostgresVerbose
}
+
+ // Does the dialect use CHAR to cast Utf8 rather than TEXT?
+ // E.g. MySQL requires CHAR instead of TEXT and automatically produces a
string with
+ // the VARCHAR, TEXT or LONGTEXT data type based on the length of the
string
+ fn use_char_for_utf8_cast(&self) -> bool {
Review Comment:
@alamb - updated: added the following Dialect configuration:
```rust
// Specifies which data type to use for Arrow Utf8 unparsing
// Most dialects use VARCHAR, but some, like MySQL, require CHAR
fn utf8_cast_dtype(&self) -> ast::DataType {
ast::DataType::Varchar(None)
}
// Specifies which data type to use for Arrow LargeUtf8 unparsing
// Most dialects use TEXT, but some, like MySQL, require CHAR
fn large_utf8_cast_dtype(&self) -> ast::DataType {
ast::DataType::Text
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]