xiedeyantu commented on code in PR #4525: URL: https://github.com/apache/calcite/pull/4525#discussion_r2325325625
########## core/src/test/java/org/apache/calcite/rex/RexProgramTest.java: ########## @@ -3559,6 +3582,30 @@ private static String getString(Map<RexNode, RexNode> map) { checkSimplify(or(eq(literal(10), vInt(0)), isNull(vInt(0))), expected); } + @Test void testSimplifyOrIsNotDistinctFrom() { + RexNode aRef = input(tInt(true), 0); + RexLiteral l10 = literal(10); + RexLiteral l20 = literal(20); + RexLiteral l30 = literal(30); + + checkSimplify(or(isNotDistinctFrom(aRef, l10), isNotDistinctFrom(aRef, l20)), + "SEARCH($0, Sarg[10, 20; NULL AS FALSE])"); + checkSimplify(or(isNotDistinctFrom(aRef, l10), isNotDistinctFrom(aRef, l20), eq(aRef, l30)), + "SEARCH($0, Sarg[10, 20, 30])"); + } + + @Test void testSimplifyOrIsDistinctFrom() { + RexNode aRef = input(tInt(true), 0); + RexLiteral l10 = literal(10); + RexLiteral l20 = literal(20); + RexLiteral l30 = literal(30); + + checkSimplify(or(isDistinctFrom(aRef, l10), isDistinctFrom(aRef, l20)), + "SEARCH($0, Sarg[TRUE])"); Review Comment: Can SEARCH($0, Sarg[TRUE]) be further simplified to TRUE? -- 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: commits-unsubscr...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org