snuyanzin commented on code in PR #28520:
URL: https://github.com/apache/flink/pull/28520#discussion_r3464972915


##########
flink-table/flink-table-planner/src/main/java/org/apache/calcite/sql/type/SqlTypeUtil.java:
##########
@@ -1099,11 +1100,16 @@ public static SqlDataTypeSpec convertTypeToSpec(
                     new SqlBasicTypeNameSpec(
                             typeName, precision, scale, charSetName, 
SqlParserPos.ZERO);
         } else if (isCollection(type)) {
+            // FLINK MODIFICATION BEGIN
+            final RelDataType componentType = getComponentTypeOrThrow(type);
             typeNameSpec =
-                    new SqlCollectionTypeNameSpec(
-                            
convertTypeToSpec(getComponentTypeOrThrow(type)).getTypeNameSpec(),
+                    new ExtendedSqlCollectionTypeNameSpec(
+                            convertTypeToSpec(componentType).getTypeNameSpec(),
+                            componentType.isNullable(),
                             typeName,
+                            true,
                             SqlParserPos.ZERO);
+            // FLINK MODIFICATION END

Review Comment:
   follow up on this comment 
https://github.com/apache/flink/pull/28298#discussion_r3458573718
   
   it is not a Calcite bug, rather the way how Flink uses Calcite.
   
   We already have `ExtendedSqlCollectionTypeNameSpec` similar to 
`ExtendedSqlRowTypeNameSpec`, so should use it as it is also slightly different 
how nullability is derived comparing to Calcite.
   
   See 15 lines below in this class same approach for 
`ExtendedSqlRowTypeNameSpec`



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