You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "snuyanzin (via GitHub)" <gi...@apache.org> on 2026/06/24 06:21:00 UTC

[PR] [FLINK-39982][table] Drop `SqlCollectionTypeNameSpec` and `SqlJsonQueryFunction` from Flink codebase [flink]

snuyanzin opened a new pull request, #28520:
URL: https://github.com/apache/flink/pull/28520

   # What is the purpose of the change
   
   This is follow up PR after Calcite upgrade to 1.40.0
   
   There 2 Calcite classes which might be removed from Flink codebase
   
   ## Brief change log
   
   SqlTypeUtil and 2 removed classes
   
   ## Verifying this change
   
   existing tests
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): ( no)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no)
     - The serializers: (no)
     - The runtime per-record code paths (performance sensitive): (no)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (no)
     - The S3 file system connector: (no)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? ( no)
     - If yes, how is the feature documented? (not applicable)
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   <!--
   If generative AI tooling has been used in the process of authoring this PR, please
   change the checkbox below to `[X]` followed by the name of the tool, and uncomment the
   "Generated-by" line. See the ASF Generative Tooling Guidance for details:
   https://www.apache.org/legal/generative-tooling.html
   
   You are responsible for the quality and correctness of every change in this PR
   regardless of the tooling used. Low-effort AI-generated PRs will be closed. See
   AGENTS.md for the full guidance.
   -->
   
   - [ ] Yes (please specify the tool below)
   
   <!--
   Generated-by: [Tool Name and Version]
   -->
   


-- 
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: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-39982][table] Drop `SqlCollectionTypeNameSpec` and `SqlJsonQueryFunction` from Flink codebase [flink]

Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
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_r3458217685
   
   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: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-39982][table] Drop `SqlCollectionTypeNameSpec` and `SqlJsonQueryFunction` from Flink codebase [flink]

Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
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.
   
   Se 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: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-39982][table] Drop `SqlCollectionTypeNameSpec` and `SqlJsonQueryFunction` from Flink codebase [flink]

Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
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_r3458217685
   
   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: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-39982][table] Drop `SqlCollectionTypeNameSpec` and `SqlJsonQueryFunction` from Flink codebase [flink]

Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin merged PR #28520:
URL: https://github.com/apache/flink/pull/28520


-- 
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: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-39982][table] Drop `SqlCollectionTypeNameSpec` and `SqlJsonQueryFunction` from Flink codebase [flink]

Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
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: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-39982][table] Drop `SqlCollectionTypeNameSpec` and `SqlJsonQueryFunction` from Flink codebase [flink]

Posted by "flinkbot (via GitHub)" <gi...@apache.org>.
flinkbot commented on PR #28520:
URL: https://github.com/apache/flink/pull/28520#issuecomment-4786505778

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "74ef826eb70a6bf6a7d6b90c85d1b0aac4d9e1bd",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "74ef826eb70a6bf6a7d6b90c85d1b0aac4d9e1bd",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 74ef826eb70a6bf6a7d6b90c85d1b0aac4d9e1bd UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

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