strongduanmu commented on code in PR #27258:
URL: https://github.com/apache/shardingsphere/pull/27258#discussion_r1266048429


##########
kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/TypeCastExpressionConverter.java:
##########
@@ -43,7 +43,25 @@ public Optional<SqlNode> convert(final TypeCastExpression 
segment) {
         if (!expression.isPresent()) {
             return Optional.empty();
         }
-        SqlTypeNameSpec sqlTypeName = new 
SqlBasicTypeNameSpec(SqlTypeName.valueOf(segment.getDataType().toUpperCase()), 
SqlParserPos.ZERO);
+        String typeName = segment.getDataType().toUpperCase();
+        switch (typeName) {
+            case "INT2":

Review Comment:
   > > Why do this type convert?
   > 
   > You can view the supported SQL data types in 
org/apache/calcite/sql/type/SqlTypeName.java. This file contains the 
enumeration of all the standard SQL data types that are supported by Calcite. 
If you want to use a non-standard SQL data type in your queries, you will need 
to map it to its closest standard SQL data type before passing it to Calcite.
   
   Ok, I got it. Is this conversion logic only valid for PostgreSQL? We should 
probably design the SPI by databaseType to isolate these logics.



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