xzh_dz created CALCITE-4774:
-------------------------------
Summary: When predicate conditions are equivalent, materialized
view recognition fails.
Key: CALCITE-4774
URL: https://issues.apache.org/jira/browse/CALCITE-4774
Project: Calcite
Issue Type: New Feature
Reporter: xzh_dz
{code:java}
// code placeholder
org.apache.calcite.test.MaterializedViewSubstitutionVisitorTest
@Test void testRexCondition() {
final String mv = ""
+ "select \"name\"\n"
+ "from \"emps\"\n"
+ "where \"deptno\" > 100 and \"deptno\" > 50\n"
+ "group by \"name\"";
final String query = ""
+ "select \"name\"\n"
+ "from \"emps\"\n"
+ "where \"deptno\" > 100"
+ "group by \"name\"";
sql(mv, query).withChecker(
resultContains(""
+ "EnumerableTableScan(table=[[hr, MV0]])")).ok();
}
{code}
Materialized view failed to be matched by optimized results:Materialized view
failed to be matched by optimized results: java.lang.AssertionError:
Materialized view failed to be matched by optimized results: at
org.apache.calcite.test.AbstractMaterializedViewTest.checkMaterialize(AbstractMaterializedViewTest.java:116)
at
org.apache.calcite.test.AbstractMaterializedViewTest.access$000(AbstractMaterializedViewTest.java:67)
at
org.apache.calcite.test.AbstractMaterializedViewTest$Sql.ok(AbstractMaterializedViewTest.java:229)
--
This message was sent by Atlassian Jira
(v8.3.4#803005)