snuyanzin commented on code in PR #21759:
URL: https://github.com/apache/flink/pull/21759#discussion_r1097975941
##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/codegen/calls/SearchOperatorGen.scala:
##########
@@ -96,7 +96,9 @@ object SearchOperatorGen {
|boolean $nullTerm = true;
|if (!${needle.nullTerm}) {
| $resultTerm = $negation$setTerm.contains(${needle.resultTerm});
- | $nullTerm = !$resultTerm && $setTerm.containsNull();
+ | $nullTerm = false;
+ |} else {
+ | $resultTerm = $setTerm.containsNull();
Review Comment:
Sorry, seems I missed your question...
The info was taken from here
https://issues.apache.org/jira/browse/CALCITE-4446
also `containsNull` is initialized in constructor as `containsNull = nullAs
== RexUnknownAs.TRUE`
https://github.com/apache/calcite/blob/cbfe0609edcc4a843d71497f159e3687a834119e/core/src/main/java/org/apache/calcite/util/Sarg.java#L118-L123
btw since 1.30.0 `containsNull` is removed, that's why I replaced it.
I also added tests for cases `nullAs == RexUnknownAs.FALSE` and `nullAs ==
RexUnknownAs.UNKNOWN` based on description from CALCITE-4446
--
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]