NobiGo commented on code in PR #3263:
URL: https://github.com/apache/calcite/pull/3263#discussion_r1241140783
##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -5594,6 +5619,90 @@ private static void checkIf(SqlOperatorFixture f) {
f.checkNull("array_union(cast(null as integer array), cast(null as integer
array))");
}
+ /** Tests {@code ARRAYS_OVERLAP} function from Spark. */
+ @Test void testArraysOverlapFunc() {
+ final SqlOperatorFixture f0 = fixture();
+ f0.setFor(SqlLibraryOperators.ARRAYS_OVERLAP);
+ f0.checkFails("^arrays_overlap(array[1, 2], array[2])^",
+ "No match found for function signature ARRAYS_OVERLAP\\("
+ + "<INTEGER ARRAY>, <INTEGER ARRAY>\\)", false);
+
+ final SqlOperatorFixture f = f0.withLibrary(SqlLibrary.SPARK);
+ f.checkScalar("arrays_overlap(array[1, 2], array[2])", true,
+ "BOOLEAN NOT NULL");
+ f.checkScalar("arrays_overlap(array[1, 2], array[3])", false,
+ "BOOLEAN NOT NULL");
+ f.checkScalar("arrays_overlap(array[1, null], array[1])", true,
Review Comment:
@liuyongvs Maybe we can test in Spark By:
`arrays_overlap(array[1, null], array[1]) IS NOT NULL` ?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]