Quanlong Huang has uploaded this change for review. ( http://gerrit.cloudera.org:8080/17184
Change subject: IMPALA-10483(part-1): Refactor table mask resolving ...................................................................... IMPALA-10483(part-1): Refactor table mask resolving Table masking(i.e. column-masking/row-filtering) is resolved in the analyzing phase when resolving the based table/view. The based table/view is then replaced by a table masking view. After the analyzing phase, the query may be rewritten, which requires re-analyzing. Reset() will be called on the AST to reset all the analyzed states before re-analyze it again. Currently, we consider table masking as the result of analyzing, so we revert them in FromClause.reset(). This avoids duplicated masking. However, it may result in a suboptimal plan since no query rewritters will be applied after the re-analyzing phase. What's worse, it can't avoid duplicated masking in the query rewriting phase which will also analyze some rewritten AST. This happens more frequently in supporting subquery row filters. Since the subquery will be rewritten into JOIN and being reanalyzed in the rewriter. This patch refactor the table mask resolving logic to not apply table mask by default. Only the first analyzing phase requires masking. With this change, we don't need the complex logic in FromClause.reset() to revert the masking. Its implementation is reverted to the behavior before we support column masking. Tests - This is a refactoring so no new tests are added. Change-Id: Ia191928fb179b0b0632235c1fff4c18647e5802f --- M fe/src/main/java/org/apache/impala/analysis/AnalysisContext.java M fe/src/main/java/org/apache/impala/analysis/Analyzer.java M fe/src/main/java/org/apache/impala/analysis/CreateTableAsSelectStmt.java M fe/src/main/java/org/apache/impala/analysis/Expr.java M fe/src/main/java/org/apache/impala/analysis/FromClause.java M fe/src/main/java/org/apache/impala/analysis/InlineViewRef.java M fe/src/main/java/org/apache/impala/analysis/InsertStmt.java 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/StatementBase.java M fe/src/main/java/org/apache/impala/analysis/Subquery.java M fe/src/main/java/org/apache/impala/analysis/WithClause.java M fe/src/main/java/org/apache/impala/authorization/TableMask.java 13 files changed, 79 insertions(+), 60 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/84/17184/1 -- To view, visit http://gerrit.cloudera.org:8080/17184 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia191928fb179b0b0632235c1fff4c18647e5802f Gerrit-Change-Number: 17184 Gerrit-PatchSet: 1 Gerrit-Owner: Quanlong Huang <[email protected]>
