[CALCITE-6718] Optimize SubstitutionVisitor's splitFilter with early return and uniform simplification for equivalence checking #4078
Annotations
10 errors
Test:
DateRangeRulesTest.java#L701
0.1sec org.apache.calcite.rel.rules.DateRangeRulesTest > testExtractRewriteForInvalidMonthComparison()
java.lang.AssertionError: result mismatch (unknown as UNKNOWN): when applied to {$9=NULL},
AND(AND(>=($9, 2010-01-01 00:00:00), <($9, 2011-01-01 00:00:00)), AND(>=($9, 2010-01-01 00:00:00), <($9, 2010-02-01 00:00:00))) yielded NULL;
SEARCH($9, Sarg[[2010-01-01 00:00:00..2010-02-01 00:00:00); NULL AS FALSE]) yielded false
at org.apache.calcite.rex.RexSimplify.verify(RexSimplify.java:2177)
at org.apache.calcite.rex.RexSimplify.simplifyUnknownAs(RexSimplify.java:253)
at org.apache.calcite.rex.RexSimplify.simplify(RexSimplify.java:226)
at org.apache.calcite.rel.rules.DateRangeRulesTest.checkDateRange(DateRangeRulesTest.java:701)
at org.apache.calcite.rel.rules.DateRangeRulesTest.checkDateRange(DateRangeRulesTest.java:694)
at org.apache.calcite.rel.rules.DateRangeRulesTest.testExtractRewriteForInvalidMonthComparison(DateRangeRulesTest.java:334)
|
Test:
DateRangeRulesTest.java#L701
0.0sec org.apache.calcite.rel.rules.DateRangeRulesTest > testExtractYearMonthDayFromDateColumn()
java.lang.AssertionError: result mismatch (unknown as UNKNOWN): when applied to {$8=NULL},
AND(>=($8, 2011-01-01), AND(>=($8, 2011-01-01), <($8, 2020-01-01)), OR(AND(>=($8, 2011-02-01), <($8, 2011-03-01)), AND(>=($8, 2012-02-01), <($8, 2012-03-01)), AND(>=($8, 2013-02-01), <($8, 2013-03-01)), AND(>=($8, 2014-02-01), <($8, 2014-03-01)), AND(>=($8, 2015-02-01), <($8, 2015-03-01)), AND(>=($8, 2016-02-01), <($8, 2016-03-01)), AND(>=($8, 2017-02-01), <($8, 2017-03-01)), AND(>=($8, 2018-02-01), <($8, 2018-03-01)), AND(>=($8, 2019-02-01), <($8, 2019-03-01))), OR(AND(>=($8, 2012-02-29), <($8, 2012-03-01)), AND(>=($8, 2016-02-29), <($8, 2016-03-01)))) yielded NULL;
SEARCH($8, Sarg[[2012-02-29..2012-03-01), [2016-02-29..2016-03-01); NULL AS FALSE]) yielded false
at org.apache.calcite.rex.RexSimplify.verify(RexSimplify.java:2177)
at org.apache.calcite.rex.RexSimplify.simplifyUnknownAs(RexSimplify.java:253)
at org.apache.calcite.rex.RexSimplify.simplify(RexSimplify.java:226)
at org.apache.calcite.rel.rules.DateRangeRulesTest.checkDateRange(DateRangeRulesTest.java:701)
at org.apache.calcite.rel.rules.DateRangeRulesTest.checkDateRange(DateRangeRulesTest.java:694)
at org.apache.calcite.rel.rules.DateRangeRulesTest.testExtractYearMonthDayFromDateColumn(DateRangeRulesTest.java:139)
|
Test:
DateRangeRulesTest.java#L701
0.0sec org.apache.calcite.rel.rules.DateRangeRulesTest > testExtractYearMonthDayFromTimestampColumn()
java.lang.AssertionError: result mismatch (unknown as UNKNOWN): when applied to {$8=NULL},
AND(>=($8, 2011-01-01), AND(>=($8, 2011-01-01), <($8, 2020-01-01)), OR(AND(>=($8, 2011-02-01), <($8, 2011-03-01)), AND(>=($8, 2012-02-01), <($8, 2012-03-01)), AND(>=($8, 2013-02-01), <($8, 2013-03-01)), AND(>=($8, 2014-02-01), <($8, 2014-03-01)), AND(>=($8, 2015-02-01), <($8, 2015-03-01)), AND(>=($8, 2016-02-01), <($8, 2016-03-01)), AND(>=($8, 2017-02-01), <($8, 2017-03-01)), AND(>=($8, 2018-02-01), <($8, 2018-03-01)), AND(>=($8, 2019-02-01), <($8, 2019-03-01))), OR(AND(>=($8, 2012-02-29), <($8, 2012-03-01)), AND(>=($8, 2016-02-29), <($8, 2016-03-01)))) yielded NULL;
SEARCH($8, Sarg[[2012-02-29..2012-03-01), [2016-02-29..2016-03-01); NULL AS FALSE]) yielded false
at org.apache.calcite.rex.RexSimplify.verify(RexSimplify.java:2177)
at org.apache.calcite.rex.RexSimplify.simplifyUnknownAs(RexSimplify.java:253)
at org.apache.calcite.rex.RexSimplify.simplify(RexSimplify.java:226)
at org.apache.calcite.rel.rules.DateRangeRulesTest.checkDateRange(DateRangeRulesTest.java:701)
at org.apache.calcite.rel.rules.DateRangeRulesTest.checkDateRange(DateRangeRulesTest.java:694)
at org.apache.calcite.rel.rules.DateRangeRulesTest.testExtractYearMonthDayFromTimestampColumn(DateRangeRulesTest.java:160)
|
Test:
DateRangeRulesTest.java#L701
0.0sec org.apache.calcite.rel.rules.DateRangeRulesTest > testUnboundYearExtractRewrite()
java.lang.AssertionError: result mismatch (unknown as UNKNOWN): when applied to {$9=NULL},
AND(<($9, 2011-01-01 00:00:00), AND(>=($9, 2010-01-01 00:00:00), <($9, 2011-01-01 00:00:00)), AND(>=($9, 2010-05-01 00:00:00), <($9, 2010-06-01 00:00:00))) yielded NULL;
SEARCH($9, Sarg[[2010-05-01 00:00:00..2010-06-01 00:00:00); NULL AS FALSE]) yielded false
at org.apache.calcite.rex.RexSimplify.verify(RexSimplify.java:2177)
at org.apache.calcite.rex.RexSimplify.simplifyUnknownAs(RexSimplify.java:253)
at org.apache.calcite.rex.RexSimplify.simplify(RexSimplify.java:226)
at org.apache.calcite.rel.rules.DateRangeRulesTest.checkDateRange(DateRangeRulesTest.java:701)
at org.apache.calcite.rel.rules.DateRangeRulesTest.checkDateRange(DateRangeRulesTest.java:694)
at org.apache.calcite.rel.rules.DateRangeRulesTest.testUnboundYearExtractRewrite(DateRangeRulesTest.java:378)
|
Test:
RexProgramTest.java#L2312
0.0sec org.apache.calcite.rex.RexProgramTest > testSargMerge()
java.lang.AssertionError: result mismatch (unknown as UNKNOWN): when applied to {?0.int0=NULL},
AND(>(?0.int0, 5), <(?0.int0, 3)) yielded NULL;
false yielded false
at org.apache.calcite.rex.RexSimplify.verify(RexSimplify.java:2177)
at org.apache.calcite.rex.RexSimplify.simplifyUnknownAs(RexSimplify.java:253)
at org.apache.calcite.rex.RexProgramTestBase.checkSimplifyAs(RexProgramTestBase.java:147)
at org.apache.calcite.rex.RexProgramTestBase.checkSimplify3_(RexProgramTestBase.java:131)
at org.apache.calcite.rex.RexProgramTestBase.checkSimplify3(RexProgramTestBase.java:118)
at org.apache.calcite.rex.RexProgramTest.testSargMerge(RexProgramTest.java:2312)
|
Test:
RexProgramTest.java#L975
0.1sec org.apache.calcite.rex.RexProgramTest > testSimplify()
java.lang.AssertionError: simplify(unknown as UNKNOWN): AND(<=(?0.h, 1), >(?0.h, 1))
Expected: with toString() is "<>(?0.h, ?0.h)"
but: toString() was "false"
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:18)
at org.apache.calcite.rex.RexProgramTestBase.checkSimplifyAs(RexProgramTestBase.java:148)
at org.apache.calcite.rex.RexProgramTestBase.checkSimplify3_(RexProgramTestBase.java:131)
at org.apache.calcite.rex.RexProgramTestBase.checkSimplify3(RexProgramTestBase.java:118)
at org.apache.calcite.rex.RexProgramTest.testSimplify(RexProgramTest.java:975)
|
Test:
RexProgramTest.java#L2642
0.0sec org.apache.calcite.rex.RexProgramTest > testSimplifyIsNotNullWithDeterministic()
java.lang.AssertionError: simplify(unknown as UNKNOWN): AND(OR(IS NOT NULL(DC()), >(?0.int2, 2)), IS NOT NULL(DC()))
Expected: with toString() is "AND(OR(IS NOT NULL(DC()), >(?0.int2, 2)), IS NOT NULL(DC()))"
but: toString() was "IS NOT NULL(DC())"
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:18)
at org.apache.calcite.rex.RexProgramTestBase.checkSimplifyAs(RexProgramTestBase.java:148)
at org.apache.calcite.rex.RexProgramTestBase.checkSimplify3_(RexProgramTestBase.java:131)
at org.apache.calcite.rex.RexProgramTestBase.checkSimplify2(RexProgramTestBase.java:110)
at org.apache.calcite.rex.RexProgramTest.testSimplifyIsNotNullWithDeterministic(RexProgramTest.java:2642)
|
Test:
RexProgramTest.java#L2118
0.0sec org.apache.calcite.rex.RexProgramTest > testSimplifyEqualityAndNotEqualityWithOverlapping()
java.lang.AssertionError: result mismatch (unknown as UNKNOWN): when applied to {?0.int0=NULL},
AND(=(?0.int0, 5), <>(?0.int0, 3)) yielded NULL;
AND(IS NOT NULL(?0.int0), =(?0.int0, 5)) yielded false
at org.apache.calcite.rex.RexSimplify.verify(RexSimplify.java:2177)
at org.apache.calcite.rex.RexSimplify.simplifyUnknownAs(RexSimplify.java:253)
at org.apache.calcite.rex.RexProgramTestBase.checkSimplifyAs(RexProgramTestBase.java:147)
at org.apache.calcite.rex.RexProgramTestBase.checkSimplify3_(RexProgramTestBase.java:131)
at org.apache.calcite.rex.RexProgramTestBase.checkSimplify(RexProgramTestBase.java:90)
at org.apache.calcite.rex.RexProgramTest.testSimplifyEqualityAndNotEqualityWithOverlapping(RexProgramTest.java:2118)
|
Test:
MaterializedViewRelOptRulesTest.java#L510
0.3sec org.apache.calcite.test.MaterializedViewRelOptRulesTest > testJoinAggregateMaterializationNoAggregateFuncs9()
java.lang.AssertionError: Materialized view failed to be matched by optimized results:
EnumerableAggregate(group=[{2}])
EnumerableHashJoin(condition=[=($0, $1)], joinType=[inner])
EnumerableCalc(expr#0..4=[{inputs}], deptno=[$t1])
EnumerableTableScan(table=[[hr, emps]])
EnumerableCalc(expr#0..3=[{inputs}], deptno=[$t1], empid=[$t2])
EnumerableHashJoin(condition=[=($0, $3)], joinType=[inner])
EnumerableCalc(expr#0..1=[{inputs}], expr#2=[CAST($t1):VARCHAR], name0=[$t2])
EnumerableTableScan(table=[[hr, locations]])
EnumerableCalc(expr#0..4=[{inputs}], expr#5=[CAST($t3):VARCHAR], deptno=[$t0], empid=[$t2], name10=[$t5])
EnumerableHashJoin(condition=[=($1, $4)], joinType=[inner])
EnumerableCalc(expr#0..3=[{inputs}], expr#4=[CAST($t1):VARCHAR], expr#5=[Sarg[(10..20)]], expr#6=[SEARCH($t0, $t5)], deptno=[$t0], name0=[$t4], $condition=[$t6])
EnumerableTableScan(table=[[hr, depts]])
EnumerableCalc(expr#0..1=[{inputs}], expr#2=[CAST($t1):VARCHAR], proj#0..2=[{exprs}])
EnumerableTableScan(table=[[hr, dependents]])
at org.apache.calcite.test.MaterializedViewTester.checkMaterialize(MaterializedViewTester.java:82)
at org.apache.calcite.test.MaterializedViewFixture.ok(MaterializedViewFixture.java:56)
at org.apache.calcite.test.MaterializedViewRelOptRulesTest.testJoinAggregateMaterializationNoAggregateFuncs9(MaterializedViewRelOptRulesTest.java:510)
|
Test:
MaterializedViewRelOptRulesTest.java#L716
0.2sec org.apache.calcite.test.MaterializedViewRelOptRulesTest > testJoinAggregateMaterializationAggregateFuncs11()
java.lang.AssertionError: Materialized view failed to be matched by optimized results:
EnumerableCalc(expr#0..1=[{inputs}], expr#2=[1], expr#3=[+($t1, $t2)], empid=[$t0], EXPR$1=[$t3])
EnumerableAggregate(group=[{2}], agg#0=[COUNT()])
EnumerableHashJoin(condition=[=($0, $1)], joinType=[inner])
EnumerableCalc(expr#0..4=[{inputs}], deptno=[$t1])
EnumerableTableScan(table=[[hr, emps]])
EnumerableCalc(expr#0..3=[{inputs}], deptno=[$t1], empid=[$t2])
EnumerableHashJoin(condition=[=($0, $3)], joinType=[inner])
EnumerableCalc(expr#0..1=[{inputs}], expr#2=[CAST($t1):VARCHAR], name0=[$t2])
EnumerableTableScan(table=[[hr, locations]])
EnumerableCalc(expr#0..4=[{inputs}], expr#5=[CAST($t3):VARCHAR], deptno=[$t0], empid=[$t2], name10=[$t5])
EnumerableHashJoin(condition=[=($1, $4)], joinType=[inner])
EnumerableCalc(expr#0..3=[{inputs}], expr#4=[CAST($t1):VARCHAR], expr#5=[Sarg[(10..20)]], expr#6=[SEARCH($t0, $t5)], deptno=[$t0], name0=[$t4], $condition=[$t6])
EnumerableTableScan(table=[[hr, depts]])
EnumerableCalc(expr#0..1=[{inputs}], expr#2=[CAST($t1):VARCHAR], proj#0..2=[{exprs}])
EnumerableTableScan(table=[[hr, dependents]])
at org.apache.calcite.test.MaterializedViewTester.checkMaterialize(MaterializedViewTester.java:82)
at org.apache.calcite.test.MaterializedViewFixture.ok(MaterializedViewFixture.java:56)
at org.apache.calcite.test.MaterializedViewRelOptRulesTest.testJoinAggregateMaterializationAggregateFuncs11(MaterializedViewRelOptRulesTest.java:716)
|
Loading