Steve Carlin has uploaded this change for review. ( http://gerrit.cloudera.org:8080/23867
Change subject: IMPALA-14102: [part 3] Modified LoptOptimizeJoinRule with Impala changes ...................................................................... IMPALA-14102: [part 3] Modified LoptOptimizeJoinRule with Impala changes The first cut of LoptOptimizeJoinRule class was imported from Calcite 1.37. This has not been used yet but served as a base for future Impala changes on this class. This commit provides the changes that are needed for the rule to allow Impala specific join optimization code. The rule name has been changed to ImpalaLoptOptimizeJoinRule to underscore that this is Impala specific code. There are some basic name changes of variables, methods, configurations that were chagned. The two main functionalities added to the rule are hooks which allow Impala specific code to be called. The hooks are: - getCumulativeCost(): returns a RelOptCost for a given RelNode - swapInputs: returns true if the provided left input and right input should have their order switched. The main change for getCumulativeCost ensures that the lowest level table scan only takes into account the columns that are used by its parent when calculating cost. Eventually, this will also take into account runtime filters in the next part commited for IMPALA-14102. The main change for swapInputs uses the cost model to determine if the inputs should be swapped rather than relying on row counts. This also becomes necessary when dealing with runtime filters and has an effect on complicated queries as well. Testing: Tpcds queries have been changed. Also, TBD for additional tests. Change-Id: I525a03d57047a95ece92a258096b4a5e52db331e --- A java/calcite-planner/src/main/java/org/apache/impala/calcite/rules/ImpalaLoptOptimizeJoinHooks.java R java/calcite-planner/src/main/java/org/apache/impala/calcite/rules/ImpalaLoptOptimizeJoinRule.java A java/calcite-planner/src/main/java/org/apache/impala/calcite/rules/ImpalaMQContext.java M java/calcite-planner/src/main/java/org/apache/impala/calcite/schema/ImpalaRelMdNonCumulativeCost.java M java/calcite-planner/src/main/java/org/apache/impala/calcite/service/CalciteOptimizer.java M java/calcite-planner/src/main/java/org/apache/impala/calcite/service/CalciteRelNodeConverter.java M testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q04.test M testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q17.test M testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q23b.test M testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q45.test M testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q58.test M testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q61.test M testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q64.test M testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q65.test M testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q68.test M testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q69.test M testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q72.test M testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q74.test M testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q81.test M testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q83.test M testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q84.test M testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q95.test 22 files changed, 7,979 insertions(+), 7,668 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/67/23867/4 -- To view, visit http://gerrit.cloudera.org:8080/23867 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I525a03d57047a95ece92a258096b4a5e52db331e Gerrit-Change-Number: 23867 Gerrit-PatchSet: 4 Gerrit-Owner: Steve Carlin <[email protected]> Gerrit-Reviewer: Michael Smith <[email protected]>
