Michael Smith has uploaded a new patch set (#2) to the change originally 
created by Stamatis Zampetakis. ( http://gerrit.cloudera.org:8080/24787 )

Change subject: IMPALA-15327: CTE rewrite algorithm cannot explore all 
suggestions
......................................................................

IMPALA-15327: CTE rewrite algorithm cannot explore all suggestions

The rewrite algorithm relies on the MaterializedViewRule hierarchy. In
order to perform a rewrite the MV rules use the following
RelMetadataQuery APIs:

* RelMetadataQuery#getNodeTypes
* RelMetadataQuery#getAllPredicates
* RelMetadataQuery#getExpressionLineage
* RelMetadataQuery#getTableReferences

However, the standard BuiltInMetadata handlers provided by Calcite don't
recognize the ImpalaCTEConsumer operator so once it is introduced in the
plan by one rewrite all the rest that fall in the same RelSubset are
nuked.

The commit adds customised handlers for returning the appropriate
metadata when encountering ImpalaCTEConsumer allowing further rewrites
to trigger properly and explore the entire search space.

Change-Id: Ic32d11cd82e2484944b6d03d5fb56900e8e1b7a4
---
A 
java/calcite-planner/src/main/java/org/apache/impala/calcite/schema/ImpalaRelMdAllPredicates.java
A 
java/calcite-planner/src/main/java/org/apache/impala/calcite/schema/ImpalaRelMdExpressionLineage.java
A 
java/calcite-planner/src/main/java/org/apache/impala/calcite/schema/ImpalaRelMdNodeTypes.java
A 
java/calcite-planner/src/main/java/org/apache/impala/calcite/schema/ImpalaRelMdTableReferences.java
M 
java/calcite-planner/src/main/java/org/apache/impala/calcite/schema/ImpalaRelMetadataProvider.java
M 
java/calcite-planner/src/main/java/org/apache/impala/calcite/service/CalciteOptimizer.java
M 
testdata/workloads/functional-planner/queries/PlannerTest/tpcds_cte/tpcds-q75.test
7 files changed, 2,855 insertions(+), 2,315 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/87/24787/2
--
To view, visit http://gerrit.cloudera.org:8080/24787
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic32d11cd82e2484944b6d03d5fb56900e8e1b7a4
Gerrit-Change-Number: 24787
Gerrit-PatchSet: 2
Gerrit-Owner: Stamatis Zampetakis <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>

Reply via email to