sgrebnov commented on code in PR #12916:
URL: https://github.com/apache/datafusion/pull/12916#discussion_r1804189834
##########
datafusion/sql/src/unparser/dialect.rs:
##########
@@ -282,6 +288,10 @@ impl Dialect for MySqlDialect {
ast::DataType::Custom(ObjectName(vec![Ident::new("SIGNED")]), vec![])
}
+ fn int32_cast_dtype(&self) -> ast::DataType {
+ ast::DataType::Custom(ObjectName(vec![Ident::new("SIGNED")]), vec![])
Review Comment:
The change LGTM
1. MySQL `cast` does not support `Integer` or `BigInt` which are currently
used by default to unparse Int32 and Int64 unparsing. List of supported types
for MySQL cast:
https://dev.mysql.com/doc/refman/8.4/en/cast-functions.html#function_cast
1. So this PR fallbacks to using `SIGNED [INTEGER]` similar to
`int64_cast_dtype` which will produce a signed BIGINT. I prefer just `SIGNED`
to be consistent with `int64_cast_dtype` (or update both)
Possible alternative is to see if we can get rid of casting at all when it
is unnecessary as Int32 cast intention and BigInt are different
--
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]