xuzifu666 commented on code in PR #4406:
URL: https://github.com/apache/calcite/pull/4406#discussion_r2127891622
##########
core/src/main/java/org/apache/calcite/sql/dialect/PrestoSqlDialect.java:
##########
@@ -178,18 +182,46 @@ private static void unparseUsingLimit(SqlWriter writer,
@Nullable SqlNode offset
}
@Override public @Nullable SqlNode getCastSpec(RelDataType 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);
- // https://prestodb.io/docs/current/language/types.html#varbinary
- case BINARY:
- return new SqlDataTypeSpec(
- new SqlBasicTypeNameSpec(SqlTypeName.VARBINARY, SqlParserPos.ZERO),
SqlParserPos.ZERO);
- default:
- return super.getCastSpec(type);
+ if (type instanceof AbstractSqlType) {
Review Comment:
Yes, had remove the judgment.
--
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]