mirror of
https://github.com/apache/impala.git
synced 2026-01-10 18:00:14 -05:00
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 <impala-public-jenkins@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>