julianhyde commented on a change in pull request #2357:
URL: https://github.com/apache/calcite/pull/2357#discussion_r585828228
##########
File path: core/src/test/java/org/apache/calcite/rex/RexProgramTest.java
##########
@@ -931,15 +931,17 @@ private void checkExponentialCnf(int n) {
checkSimplify(rexBuilder.makeCall(SqlStdOperatorTable.IS_NOT_NULL, aRef),
"true");
- // condition, and the inverse - nothing to do due to null values
- checkSimplify2(and(le(hRef, literal(1)), gt(hRef, literal(1))),
- "AND(<=(?0.h, 1), >(?0.h, 1))",
+ // condition, and the inverse
+ checkSimplify3(and(le(hRef, literal(1)), gt(hRef, literal(1))),
+ "<>(?0.h, ?0.h)",
+ "false",
"false");
Review comment:
You are correct. Ideally it would simplify to "false" even under
unknown-as-unknown.
Can you please log a bug? (Not a sub-task, and not marked 'fix in 1.27'.)
I checked, and that case does not invoke Sarg logic, because the expression
is deemed 'too simple'. Whoever fixes the bug can revisit that logic.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]