You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "JiajunBernoulli (via GitHub)" <gi...@apache.org> on 2024/01/26 13:02:06 UTC

Re: [PR] [CALCITE-6228] ELEMENT function infers incorrect return type [calcite]

JiajunBernoulli commented on code in PR #3650:
URL: https://github.com/apache/calcite/pull/3650#discussion_r1467626454


##########
core/src/main/java/org/apache/calcite/sql/type/ReturnTypes.java:
##########
@@ -615,10 +615,11 @@ public static SqlCall stripSeparator(SqlCall call) {
       ARG0.andThen(SqlTypeTransforms.TO_MULTISET);
 
   /**
-   * Returns the element type of a MULTISET.
+   * Returns the element type of a MULTISET, with nullability enforced.
    */
   public static final SqlReturnTypeInference MULTISET_ELEMENT_NULLABLE =

Review Comment:
   Is the name appropriate?
   
   There are two field:
   - NULLABLE -> TO_NULLABLE
   ```
     public static final SqlReturnTypeInference TO_COLLECTION_ELEMENT_NULLABLE =
         TO_COLLECTION_ELEMENT.andThen(SqlTypeTransforms.TO_NULLABLE);
   ```
   FORCE_NULLABLE -> FORCE_NULLABLE
   ```
     public static final SqlReturnTypeInference TO_COLLECTION_ELEMENT_FORCE_NULLABLE =
         TO_COLLECTION_ELEMENT.andThen(SqlTypeTransforms.FORCE_NULLABLE);
   ```



-- 
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-unsubscribe@calcite.apache.org

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