[
https://issues.apache.org/jira/browse/CALCITE-4774?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Haisheng Yuan resolved CALCITE-4774.
------------------------------------
Fix Version/s: 1.28.0
Resolution: Fixed
Fixed in
https://github.com/apache/calcite/commit/60457b28c890f12cc811528bd4f3b098bc3d00f7,
thanks for the PR, [~xzh_dz].
> 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: Improvement
> Reporter: xzh_dz
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.28.0
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> {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)