Steve Carlin has uploaded this change for review. ( http://gerrit.cloudera.org:8080/22967
Change subject: IMPALA-14115: Calcite planner: Added top-n analytic PlanNode optimization. ...................................................................... IMPALA-14115: Calcite planner: Added top-n analytic PlanNode optimization. Impala has an optimization for analytic expressions that have a rank filter on top of the analytic expression. It can add a top-n plan node to reduce the amount of rows examined. This is tested in tpcds query 67. The optimization logic relies on an unassigned rank conjunct within the analyzer while creating the analytic plan node. A slight reorganization of the code was needed to implement this optimization. The SlotRefs for the AnalyticInfo needed to be created a little earlier from where it was done in the previous commit. A new AllProjectInfo internal class was created to hold the relationships between the Calcite RexNode objects and the Impala Analytic expressions. Also, IMPALA-14157 is fixed by this commit. The nullsFirst value was incorrect when the syntax was explicit in the query. Change-Id: I5697a65a16ee7902ac492ed20168ac66e1d01a91 --- M fe/src/main/java/org/apache/impala/analysis/SortInfo.java M java/calcite-planner/src/main/java/org/apache/impala/calcite/rel/node/ImpalaAnalyticRel.java M testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q44.test M testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q49.test M testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q67.test M testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q70.test 6 files changed, 1,505 insertions(+), 1,201 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/67/22967/4 -- To view, visit http://gerrit.cloudera.org:8080/22967 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I5697a65a16ee7902ac492ed20168ac66e1d01a91 Gerrit-Change-Number: 22967 Gerrit-PatchSet: 4 Gerrit-Owner: Steve Carlin <[email protected]> Gerrit-Reviewer: Aman Sinha <[email protected]> Gerrit-Reviewer: Fang-Yu Rao <[email protected]> Gerrit-Reviewer: Joe McDonnell <[email protected]> Gerrit-Reviewer: Michael Smith <[email protected]>
