NobiGo commented on code in PR #3279:
URL: https://github.com/apache/calcite/pull/3279#discussion_r1243074743


##########
core/src/test/java/org/apache/calcite/rex/RexProgramTest.java:
##########
@@ -2010,6 +2010,20 @@ private void checkExponentialCnf(int n) {
         ">(?0.int0, 0)");
   }
 
+  /** Unit test for
+   * <a 
href="https://issues.apache.org/jira/browse/CALCITE-5798";>[CALCITE-5798]
+   * '(1 < x) IS NOT TRUE' when x is not nullable should be simplified to '1 
>= x'</a>. */
+  @Test void testSimplifyInverseComparisonWithIsNotNullPredicate() {
+    final RexNode ref = input(tInt(true), 0);
+    RelOptPredicateList relOptPredicateList =
+        RelOptPredicateList.of(rexBuilder,
+            ImmutableList.of(isNotNull(ref)));
+    checkSimplifyFilter(
+        isNotTrue(gt(literal(1), ref)),

Review Comment:
   Looks like the test is the opposite. The summary is '(1 < x) IS NOT 
TRUE-->1>=x' but the test is '(1>x) IS NOT TRUE-->1<=x'. The test result is 
good. Just I think we should stay the same 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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to