hozan23 opened a new pull request, #26883:
URL: https://github.com/apache/datafusion/pull/26883

    ## Which issue does this PR close?
   
     - Closes #26882.
   
     ## Rationale for this change
   
     MySQL's `CAST` does not accept `TINYINT` as a target type, so an `Int8` 
cast unparsed with `MySqlDialect` produces SQL that MySQL rejects with `ERROR 
1064`.
   
     See 
https://dev.mysql.com/doc/refman/8.0/en/cast-functions.html#function_cast
   
     ## What changes are included in this PR?
   
     `MySqlDialect` overrides `int8_cast_dtype` to return `SIGNED`, like the 
existing `int32_cast_dtype` and `int64_cast_dtype` overrides.
   
     ## What is the testing strategy for this PR?
   
     New unit test `mysql_int8_cast_uses_signed` in 
`datafusion/sql/src/unparser/expr.rs`.
   
     ## Are there any user-facing changes?
   
     No API changes.
   


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