LiaCastaneda commented on code in PR #21903:
URL: https://github.com/apache/datafusion/pull/21903#discussion_r3160294359
##########
datafusion/sqllogictest/test_files/higher_order.slt:
##########
@@ -273,6 +273,66 @@ SELECT array_transform([1], v -> v -> v+1);
query error DataFusion error: SQL error: ParserError\("Expected: an
expression, found: \) at Line: 1, Column: 30"\)
SELECT array_transform([1], () -> 1);
+##########
+## array_any_match tests
+##########
+
+# basic: some elements match
+query B
+SELECT array_any_match([1, 2, 3], x -> x > 2);
+----
+true
+
+# basic: no elements match
+query B
+SELECT array_any_match([1, 2, 3], x -> x > 5);
+----
+false
+
+# empty array returns false
+query B
+SELECT array_any_match(arrow_cast(make_array(), 'List(Int32)'), x -> x > 0);
+----
+false
+
+# null array returns null
+query B
+SELECT array_any_match(arrow_cast(NULL, 'List(Int32)'), x -> x > 0);
+----
+NULL
+
+# predicate returns null for some elements, false for others -> null
+query B
+SELECT array_any_match([1, 2, NULL], x -> x > 5);
+----
+NULL
+
+# predicate returns null for some elements but true for others -> true
+query B
+SELECT array_any_match([1, NULL, 10], x -> x > 5);
Review Comment:
done, we cannot yet add a test for
`select a, exists(array(1, 2, 3), x-> case when a = 2 then x > 1 else null
end)
`
because column capture is not yet supported
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]