peasee commented on code in PR #12916:
URL: https://github.com/apache/datafusion/pull/12916#discussion_r1802137013


##########
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:
   > MySQL integer is signed by default
   
   I'm not sure what you mean by this. There's already a rule to rewrite 
`BIGINT` as `SIGNED`, but not for `INTEGER`. On the current version, it 
generates `CAST(.. INTEGER)` which isn't supported.
   
   > Also where do we specify it's integer and not eg bigint or tinyint?
   
   you cannot specify the size of an integer in cast with MySQL - it always 
casts to `BIGINT`. `SIGNED INTEGER` does work, but it's syntactic sugar and is 
identical to `SIGNED`.
   
   https://dev.mysql.com/doc/refman/8.4/en/cast-functions.html#function_cast



-- 
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]

Reply via email to