You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "MasseGuillaume (via GitHub)" <gi...@apache.org> on 2023/05/30 01:38:40 UTC

[GitHub] [calcite] MasseGuillaume commented on a diff in pull request #3212: [CALCITE-5710] Add ARRAY_MAX, ARRAY_MIN function (enabled in Spark li…

MasseGuillaume commented on code in PR #3212:
URL: https://github.com/apache/calcite/pull/3212#discussion_r1209623357


##########
core/src/main/java/org/apache/calcite/sql/type/ReturnTypes.java:
##########
@@ -487,6 +487,18 @@ public static SqlCall stripSeparator(SqlCall call) {
         -1);
   };
 
+  /**
+   * Returns the element type of a ARRAY or MULTISET.
+   *
+   * <p>For example, given <code>INTEGER ARRAY or MULTISET ARRAY</code>, returns
+   * <code>INTEGER</code>.
+   */
+  public static final SqlReturnTypeInference TO_COLLECTION_ELEMENT =
+      ARG0.andThen(SqlTypeTransforms.TO_COLLECTION_ELEMENT_TYPE);

Review Comment:
   Will fail with an empty array:
   https://github.com/apache/calcite/pull/3218#discussion_r1209622163



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