Quanlong Huang has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/18913 )
Change subject: IMPALA-10865: Fix initialize SelectStmt's groupingExprs_ in analyzeGroupingExprs ...................................................................... IMPALA-10865: Fix initialize SelectStmt's groupingExprs_ in analyzeGroupingExprs This patch rollback some changes of IMPALA-9620. IMPALA-9620 re- initialize SelectStmt's groupingExprs_ to ensure that group-by and cnf exprs are analyzed. But the following patch of IMPALA-9693 explicitly analyzes exprs which is equivalent to IMPALA-9620. So this rollback is safe here. In general, the analyze algorithm is that: 1. Analyze the stmt tree and make copies of expressions 2. Rewrite selected expressions, **rewrite rules should ensure rewritten exprs are analyzed** 3. Make copied expressions analyzed 4. ReAnalyze the tree The problem is that if we change the groupingExprs_ of SelectStmt, in re-analyze phase column alias will be substitude to Expr that duplicate with origin column which will be removed in `buildAggregateExprs`. Another reason why this patch is submitted is that re-initialize SelectStmt's groupingExprs_ will cause other problems. IMPALA-10096 is a typical case. See jira for detail execeptions. Beside, this patch modifies ExtractCompundVerticalBarExprRule to do a explicit analyze to ensure expr are rewritten. Test: - Add new test into aggregation.test and passed - Ran all fe tests and passed Change-Id: I9d1779e6c282d9fd02beacf5ddfafcc5c0baf3b0 Reviewed-on: http://gerrit.cloudera.org:8080/17781 Reviewed-by: Impala Public Jenkins <[email protected]> Tested-by: Impala Public Jenkins <[email protected]> Reviewed-on: http://gerrit.cloudera.org:8080/18913 Tested-by: Quanlong Huang <[email protected]> Reviewed-by: Tamas Mate <[email protected]> --- M fe/src/main/java/org/apache/impala/analysis/SelectStmt.java M fe/src/main/java/org/apache/impala/rewrite/ExtractCompoundVerticalBarExprRule.java M testdata/workloads/functional-planner/queries/PlannerTest/aggregation.test 3 files changed, 29 insertions(+), 15 deletions(-) Approvals: Quanlong Huang: Verified Tamas Mate: Looks good to me, approved -- To view, visit http://gerrit.cloudera.org:8080/18913 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: branch-4.1.1 Gerrit-MessageType: merged Gerrit-Change-Id: I9d1779e6c282d9fd02beacf5ddfafcc5c0baf3b0 Gerrit-Change-Number: 18913 Gerrit-PatchSet: 2 Gerrit-Owner: Quanlong Huang <[email protected]> Gerrit-Reviewer: Aman Sinha <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Quanlong Huang <[email protected]> Gerrit-Reviewer: Tamas Mate <[email protected]> Gerrit-Reviewer: guojingfeng <[email protected]> Gerrit-Reviewer: wangsheng <[email protected]>
