Aman Sinha has uploaded this change for review. ( http://gerrit.cloudera.org:8080/16888
Change subject: IMPALA-4805: Avoid hash exchange before analytic function if appropriate ...................................................................... IMPALA-4805: Avoid hash exchange before analytic function if appropriate This patch avoids adding a hash exchange below an analytic function that has partition by b as long as the child can satisfy that requirement through an equivalence relationship .. i.e an exact match is not required. For example: select count(*) over (partition by b) from t1, t2 where a = b In this case, the analytic sort has a required partitioning on b but the child is an inner join whose output partition key could be either 'a' or 'b' (it happens to be 'a' given how the data partition was populated), then we should still be able to use the child's partitioning without adding a hash exchange. Note that for outer joins the logic is slightly different. Testing: - Added a new planner test with analytic function + inner join (outer join test case already existed before). Change-Id: Icb6289d1e70cfb6bbd5b38eedb00856dbc85ac77 --- M fe/src/main/java/org/apache/impala/planner/DistributedPlanner.java M testdata/workloads/functional-planner/queries/PlannerTest/analytic-fns.test 2 files changed, 58 insertions(+), 1 deletion(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/88/16888/1 -- To view, visit http://gerrit.cloudera.org:8080/16888 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Icb6289d1e70cfb6bbd5b38eedb00856dbc85ac77 Gerrit-Change-Number: 16888 Gerrit-PatchSet: 1 Gerrit-Owner: Aman Sinha <[email protected]>
