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


##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/functions/CollectionFunctionsITCase.java:
##########
@@ -1723,6 +1724,83 @@ private Stream<TestSetSpec> arrayExceptTestCases() {
                                         + "ARRAY_EXCEPT(<COMMON>, <COMMON>)"));
     }
 
+    private Stream<TestSetSpec> arrayIntersectTestCases() {
+        return Stream.of(
+                
TestSetSpec.forFunction(BuiltInFunctionDefinitions.ARRAY_INTERSECT)
+                        .onFieldsWithData(
+                                new Integer[] {1, 1, 2},
+                                null,
+                                new Row[] {Row.of(true, 1), Row.of(true, 2), 
null},
+                                new Integer[] {null, null, 1},
+                                new Map[] {
+                                    CollectionUtil.map(entry(1, "a"), entry(2, 
"b")),
+                                    CollectionUtil.map(entry(3, "c"), entry(4, 
"d"))
+                                },
+                                new Integer[][] {new Integer[] {1, 2, 3}})
+                        .andDataTypes(
+                                DataTypes.ARRAY(DataTypes.INT()),
+                                DataTypes.ARRAY(DataTypes.INT()),
+                                DataTypes.ARRAY(
+                                        DataTypes.ROW(DataTypes.BOOLEAN(), 
DataTypes.INT())),
+                                DataTypes.ARRAY(DataTypes.INT()),
+                                DataTypes.ARRAY(DataTypes.MAP(DataTypes.INT(), 
DataTypes.STRING())),
+                                
DataTypes.ARRAY(DataTypes.ARRAY(DataTypes.INT())))
+                        // ARRAY<INT>
+                        .testResult(
+                                $("f0").arrayIntersect(new Integer[] {1, null, 
4}),
+                                "ARRAY_INTERSECT(f0, ARRAY[1, NULL, 4])",
+                                new Integer[] {1, 1},

Review Comment:
   In docs it is mentioned 
   > Returns an ARRAY that contains the elements from array1 that are also in 
array2, without duplicates.
   
   why do we expect duplicates here?



-- 
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-unsubscr...@flink.apache.org

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

Reply via email to