wangsheng has uploaded this change for review. ( http://gerrit.cloudera.org:8080/18099
Change subject: IMPALA-11049: Substitute order by elements when creating SortInfo ...................................................................... IMPALA-11049: Substitute order by elements when creating SortInfo Currently, Impala cloned order by elements' exprs, and substitute these cloned exprs in-place, original exprs not changed. But when executing 'SelectStmt.rewriteExprs()', Impala rewrite 'orderByElements_' instead of 'sortInfo_', which will caused AnalysisException, since these original exprs in 'orderByElements_' are 'INVALID' type. This patch will substitute exprs in 'orderByElements_' in-place, and use these substituted exprs to create 'SortInfo'. But Pay attention, this will changed explain result when printing sql. Besides, we also add a condition check in 'SimplifyCastExprRule' to keep exprs must analyzed before rewrite. Testing: - Added test cases in 'explain-level3.test' Change-Id: I2780e04a6d5a32e224cd0470cf6f166a832363ec --- M fe/src/main/java/org/apache/impala/analysis/QueryStmt.java M fe/src/main/java/org/apache/impala/analysis/SelectStmt.java M fe/src/main/java/org/apache/impala/analysis/SetOperationStmt.java M fe/src/main/java/org/apache/impala/rewrite/SimplifyCastExprRule.java M testdata/workloads/functional-query/queries/QueryTest/explain-level3.test 5 files changed, 78 insertions(+), 10 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/99/18099/1 -- To view, visit http://gerrit.cloudera.org:8080/18099 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I2780e04a6d5a32e224cd0470cf6f166a832363ec Gerrit-Change-Number: 18099 Gerrit-PatchSet: 1 Gerrit-Owner: wangsheng <[email protected]>
