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


##########
core/src/main/java/org/apache/calcite/sql/dialect/StarRocksSqlDialect.java:
##########
@@ -191,12 +196,25 @@ public StarRocksSqlDialect(Context context) {
         SqlDataTypeSpec keySpec = (SqlDataTypeSpec) 
getCastSpec(mapSqlType.getKeyType());
         SqlDataTypeSpec valueSpec =
             (SqlDataTypeSpec) getCastSpec(mapSqlType.getValueType());
-        @SuppressWarnings("argument.type.incompatible")
+        SqlDataTypeSpec nonNullKeySpec =
+            requireNonNull(keySpec, "keySpec");
+        SqlDataTypeSpec nonNullValueSpec =
+            requireNonNull(valueSpec, "valueSpec");
         SqlMapTypeNameSpec sqlMapTypeNameSpec =
-            new SqlMapTypeNameSpec(keySpec, valueSpec, SqlParserPos.ZERO);
+            new SqlMapTypeNameSpec(nonNullKeySpec, nonNullValueSpec, 
SqlParserPos.ZERO);
         return new SqlDataTypeSpec(sqlMapTypeNameSpec,
             SqlParserPos.ZERO);
       case ARRAY:
+        ArraySqlType arraySqlType = (ArraySqlType) type;

Review Comment:
   IMO,this should be the right place. All other dialect casts are here. As 
mentioned in the issue, this is to solve the compatibility problem of cast 
array. it won't affect DDL unparsing and DDL is out of scope for dialects 
currently.



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