Description
Consider the following test case in RexProgramTest.
@Test void testSimplifySearch() { // (deptno <> 20 OR deptno IS NULL) AND deptno = 10 // ==> // deptno = 10 final RexNode e = and( in(vInt(), literal(10), literal(20)), eq(vInt(), literal(10))); checkSimplify2(e, "=(?0.int0, 10)", "=(?0.int0, 10)"); }
We expect that AND(SEARCH(?0, [10, 20], =(?0, 10))) can be simplified to =(?0, 10) but fails. This is because RexSimplify#simplifyAnd and RexSimplify#simplifyOrs does not deal with the case when the complexity of SargCollector is 1.
Attachments
Issue Links
- is duplicated by
-
CALCITE-4364 Simplify "a IN (1, 2) AND a = 1" to "a = 1"
- Closed