mihaibudiu commented on code in PR #5045:
URL: https://github.com/apache/calcite/pull/5045#discussion_r3464525007
##########
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:
Do you have in mind a rule which may be buggy? For IS_TRUE/IS_FALSE(x) there
are clear rewrite rules to x/NOT(x), but for other operators non-boolean
operators I don't know what rules may be wrong.
--
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]