NobiGo commented on code in PR #3808:
URL: https://github.com/apache/calcite/pull/3808#discussion_r1626630209


##########
core/src/main/java/org/apache/calcite/sql/dialect/StarRocksSqlDialect.java:
##########
@@ -109,6 +109,20 @@ public StarRocksSqlDialect(Context context) {
 
   @Override public @Nullable SqlNode getCastSpec(RelDataType type) {
     switch (type.getSqlTypeName()) {
+    case INTEGER:
+      return new SqlDataTypeSpec(
+          new SqlAlienSystemTypeNameSpec(
+              "INT",
+              type.getSqlTypeName(),
+              SqlParserPos.ZERO),
+          SqlParserPos.ZERO);
+    case BIGINT:
+      return new SqlDataTypeSpec(
+          new SqlAlienSystemTypeNameSpec(
+              "BIGINT",

Review Comment:
   Hi @fanluoo , AFAIK, If a datatype exists in SqlTypeName, Then we use the 
SqlBasicTypeNameSpec, meas this datatype is a basic type in Calcite.  
SqlAlienSystemTypeNameSpec represents a type name for an alien system. For 
example, UNSIGNED is a built-in type in MySQL which is synonym of INTEGER. and 
STRING is synonym of VARCHAR in Spark. UNSIGNED and STRING should used 
SqlAlienSystemTypeNameSpec.  So BIGINT should used the SqlBasicTypeNameSpec



-- 
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: commits-unsubscr...@calcite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to