mihaibudiu commented on code in PR #4362:
URL: https://github.com/apache/calcite/pull/4362#discussion_r2145459342
##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -16145,6 +16145,41 @@ void testTimestampDiff(boolean coercionEnabled) {
"Values passed to = SOME operator must have compatible types", false);
}
+ /** Test case for
+ * <a
href="https://issues.apache.org/jira/browse/CALCITE-6950">[CALCITE-6950]
+ * Use ANY operator to check if an element exists in an array throws
exception</a>. */
+ @Test void testQuantifyCollectionOperators2() {
+ final SqlOperatorFixture f = fixture();
+ QUANTIFY_OPERATORS.forEach(operator -> f.setFor(operator,
SqlOperatorFixture.VmName.EXPAND));
+
+ f.checkNull("1.0 = some (ARRAY[2,3,null])");
+ f.checkNull("1.0 = some (ARRAY[2,null,3])");
+ f.checkBoolean("1.0 = some (ARRAY[1,2,null])", true);
+ f.checkBoolean("3.0 = some (ARRAY[1,2])", false);
Review Comment:
how do these tests verify that the coercion happened?
we don't know what the inserted casts are.
maybe a test that unparses the query would be more useful
--
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]