xuzifu666 commented on code in PR #4406:
URL: https://github.com/apache/calcite/pull/4406#discussion_r2127799128


##########
core/src/main/java/org/apache/calcite/sql/dialect/PrestoSqlDialect.java:
##########
@@ -178,18 +184,53 @@ 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 BasicSqlType) {

Review Comment:
   You are right, here not need to judgments for BasicSqlType  and 
AbstractSqlType, just AbstractSqlType is OK. Had changed it. @xiedeyantu 



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

Reply via email to