nuno-faria commented on code in PR #27650:
URL: https://github.com/apache/datafusion/pull/27650#discussion_r4657895454
##########
datafusion/sql/src/unparser/dialect.rs:
##########
@@ -457,6 +457,23 @@ impl Dialect for PostgreSqlDialect {
ast::DataType::SmallInt(None)
}
+ fn uint8_cast_dtype(&self) -> ast::DataType {
+ ast::DataType::SmallInt(None)
+ }
+
+ fn uint16_cast_dtype(&self) -> ast::DataType {
+ ast::DataType::Integer(None)
+ }
+
+ fn uint32_cast_dtype(&self) -> ast::DataType {
+ ast::DataType::BigInt(None)
+ }
+
+ fn uint64_cast_dtype(&self) -> ast::DataType {
+ // can overflow
+ ast::DataType::BigInt(None)
+ }
Review Comment:
I used bigint to model uint64, but it can overflow. The alternative would be
to upcast it to numeric, but I decided to handle it like sea-query:
https://docs.rs/sea-query/latest/sea_query/table/enum.ColumnType.html
--
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]