You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "hanyuzheng7 (via GitHub)" <gi...@apache.org> on 2023/07/04 07:44:03 UTC

[GitHub] [flink] hanyuzheng7 commented on a diff in pull request #22922: [FLINK-32256][table] Add built-in ARRAY_ MIN function.

hanyuzheng7 commented on code in PR #22922:
URL: https://github.com/apache/flink/pull/22922#discussion_r1251628168


##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/inference/strategies/ArrayComparableElementTypeStrategy.java:
##########
@@ -67,6 +67,9 @@ public ArgumentCount getArgumentCount() {
     public Optional<List<DataType>> inferInputTypes(
             CallContext callContext, boolean throwOnFailure) {
         final List<DataType> argumentDataTypes = callContext.getArgumentDataTypes();
+        if (argumentDataTypes.size() < 1) {
+            return Optional.empty();
+        }

Review Comment:
   Yes, we need it. In this situation -> SELECT ARRAY_MIN(), although we set argumentCount to one, but argumentDataTypes.size() == 0, if we do not check whether it is smaller than one, it report out of boundary exception.
   
   But if the input arguments number is larger than one, argumentCount will handle this situation.



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