caicancai commented on code in PR #4132:
URL: https://github.com/apache/calcite/pull/4132#discussion_r1908340416
##########
core/src/main/java/org/apache/calcite/sql/dialect/PrestoSqlDialect.java:
##########
@@ -146,7 +148,14 @@ private static void unparseUsingLimit(SqlWriter writer,
@Nullable SqlNode offset
}
@Override public @Nullable SqlNode getCastSpec(RelDataType type) {
- return super.getCastSpec(type);
+ switch (type.getSqlTypeName()) {
+ // PRESTO only supports REALăDOUBLE for floating point types.
+ case FLOAT:
+ return new SqlDataTypeSpec(
+ new SqlBasicTypeNameSpec(SqlTypeName.DOUBLE, SqlParserPos.ZERO),
SqlParserPos.ZERO);
Review Comment:
I think it is more reasonable to convert it to SqlTypeName.REAL
In some databases REAL is equivalent to Float
--
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]