xuzifu666 commented on code in PR #5045:
URL: https://github.com/apache/calcite/pull/5045#discussion_r3464922815


##########
core/src/test/java/org/apache/calcite/rex/RexProgramTest.java:
##########
@@ -3841,6 +3841,33 @@ private static String getString(Map<RexNode, RexNode> 
map) {
     assertThat(result2.getOperands().get(0), is(booleanInput));
   }
 
+  /** Test cases for <a 
href="https://issues.apache.org/jira/browse/CALCITE-7619";>[CALCITE-7619]
+   * RexSimplify incorrectly simplifies IS_FALSE(x) when x is nullable</a>. */
+  @Test void testSimplifyPreservingTypeIsNotNullCast() {
+    // IS_FALSE(nullable_bool) has type BOOLEAN NOT NULL.
+    final RexNode isFalseExpr = isFalse(vBool());

Review Comment:
   Currently, the specific rewriting rules that can trigger this bug only 
appear on the `IS_TRUE`, `IS_FALSE`, `IS_NOT_TRUE`, and `IS_NOT_FALSE` types of 
boolean, which have explicit `x` / `NOT(x)` rewriting rules. For other types, I 
can't really come up with a simplified rule that would actually cause an 
error.I agree that this test is unnecessary and not very meaningful.
   I have no other questions now.



-- 
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