Impala Public Jenkins has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/9218 )
Change subject: IMPALA-6473: Fix analytic fn that partitions and orders on same expr ...................................................................... IMPALA-6473: Fix analytic fn that partitions and orders on same expr Previously, an analytic function that used the same expr in both the 'partition by' and 'order by' clauses, and where the expr meets the criteria for being materialized before the sort, would hit an IllegalStateException due to the expr being inserted into the same ExprSubstitutionMap twice. If the values have already been partitioned on the expr, then all of the values for it in each partition will be the same and also ordering on the expr doesn't change the results. So, the fix is to simply exclude the duplicate expr from the 'order by' while still partitioning on it. Testing: - Added a regression test to PlannerTest. Change-Id: Id5f1d5fbc6f69df5850f96afed345ce27668c30b Reviewed-on: http://gerrit.cloudera.org:8080/9218 Reviewed-by: Alex Behm <[email protected]> Tested-by: Impala Public Jenkins --- M fe/src/main/java/org/apache/impala/planner/AnalyticPlanner.java M testdata/workloads/functional-planner/queries/PlannerTest/analytic-fns.test M testdata/workloads/functional-planner/queries/PlannerTest/insert.test 3 files changed, 33 insertions(+), 6 deletions(-) Approvals: Alex Behm: Looks good to me, approved Impala Public Jenkins: Verified -- To view, visit http://gerrit.cloudera.org:8080/9218 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id5f1d5fbc6f69df5850f96afed345ce27668c30b Gerrit-Change-Number: 9218 Gerrit-PatchSet: 3 Gerrit-Owner: Thomas Tauber-Marshall <[email protected]> Gerrit-Reviewer: Alex Behm <[email protected]> Gerrit-Reviewer: Impala Public Jenkins Gerrit-Reviewer: Thomas Tauber-Marshall <[email protected]>
