Stamatis Zampetakis has uploaded this change for review. ( http://gerrit.cloudera.org:8080/24870
Change subject: IMPALA-15334: Decompose unrewritable CTE suggestions to explore more rewrites ...................................................................... IMPALA-15334: Decompose unrewritable CTE suggestions to explore more rewrites In some cases the suggester returns CTEs that are not rewritable (cannot be used by the rewrite algorithm). Although, the entire CTE may not be rewritable parts of it are so by decomposing it further we can find more sharing opportunities. The commits adds MaterializedViewSubTreeSplitter to decompose a plan into maximal rewritable trees following the limitations imposed by Calcite's materialized view rules. To prevent potentially high planning times due to the bigger search space a new experimental query option, ie., cte_rewritable_decomposition, was introduced keeping the new logic disabled by default. Change-Id: I5aa335a0d61ea4b4a85a22f57e13e1e2083d0736 --- M be/src/service/query-options.cc M be/src/service/query-options.h M common/thrift/ImpalaService.thrift M common/thrift/Query.thrift A java/calcite-planner/src/main/java/org/apache/impala/calcite/rel/MaterializedViewSubTreeSplitter.java M java/calcite-planner/src/main/java/org/apache/impala/calcite/service/CalciteOptimizer.java M java/calcite-planner/src/test/java/org/apache/impala/calcite/planner/TpcdsCtePlannerTest.java M testdata/workloads/functional-planner/queries/PlannerTest/tpcds_cte/tpcds-q02.test M testdata/workloads/functional-planner/queries/PlannerTest/tpcds_cte/tpcds-q14a.test M testdata/workloads/functional-planner/queries/PlannerTest/tpcds_cte/tpcds-q14b.test M testdata/workloads/functional-planner/queries/PlannerTest/tpcds_cte/tpcds-q23a.test M testdata/workloads/functional-planner/queries/PlannerTest/tpcds_cte/tpcds-q23b.test M testdata/workloads/functional-planner/queries/PlannerTest/tpcds_cte/tpcds-q44.test M testdata/workloads/functional-planner/queries/PlannerTest/tpcds_cte/tpcds-q56.test M testdata/workloads/functional-planner/queries/PlannerTest/tpcds_cte/tpcds-q58.test M testdata/workloads/functional-planner/queries/PlannerTest/tpcds_cte/tpcds-q60.test M testdata/workloads/functional-planner/queries/PlannerTest/tpcds_cte/tpcds-q64.test M testdata/workloads/functional-planner/queries/PlannerTest/tpcds_cte/tpcds-q83.test A testdata/workloads/functional-query/queries/QueryTest/cte_decompose_false.test A testdata/workloads/functional-query/queries/QueryTest/cte_decompose_true.test M tests/query_test/test_calcite_planner.py 21 files changed, 27,899 insertions(+), 23,055 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/70/24870/1 -- To view, visit http://gerrit.cloudera.org:8080/24870 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I5aa335a0d61ea4b4a85a22f57e13e1e2083d0736 Gerrit-Change-Number: 24870 Gerrit-PatchSet: 1 Gerrit-Owner: Stamatis Zampetakis <[email protected]>
