Paul Rogers has uploaded this change for review. ( http://gerrit.cloudera.org:8080/12143
Change subject: IMPALA-8041, Part 1: Move rewrite rules into expr nodes ...................................................................... IMPALA-8041, Part 1: Move rewrite rules into expr nodes This patch is part of the task to integrate expression rewrites into the analysis process to avoid the need for two analysis passes. The analyzer provides a rewrite engine which traverses the expression tree and compares each node against a list of rewrite rules. The project goal is to apply the rules as we analyze each node. The simplest way to do so is for each node to hold the code for its own rewrites, callable via a virtual method: rewrite(). This patch is a first step: the rewrite code moves from the various rewrite rules into the expression node that is to be rewritten. In some cases nodes have a single rule which is moved from the rewrite rule directly into the rewrite() method. In other cases, a node has multiple rules. The different rules for the same node are moved into distinct methods. Though these methods are all called by the main rewrite() method, nothing calls that rewrite() method in this patch. Finally, this patch introduces a "stub" expression analyzer. In a later patch this class will drive the combined analysis/rewrite logic. For now, it is mostly a placeholder. The rewrite rules themselves are now just stubs retained to minimze change. A future patch will retire them once the analysis/rewrite integration is complete. This patch is designed to have no functional change: code merely moves from one location (the rewrite rules) to another (the expression nodes). Some "shim" code is added, but the functionality is unchanged. Tests: reran all FE tests to verify no change in behavior. Change-Id: Ifda7082abea4f6448e6cfef0d9ef7b8565d73fce --- M fe/src/main/java/org/apache/impala/analysis/Analyzer.java M fe/src/main/java/org/apache/impala/analysis/BetweenPredicate.java M fe/src/main/java/org/apache/impala/analysis/BinaryPredicate.java M fe/src/main/java/org/apache/impala/analysis/CaseExpr.java M fe/src/main/java/org/apache/impala/analysis/CompoundPredicate.java M fe/src/main/java/org/apache/impala/analysis/Expr.java A fe/src/main/java/org/apache/impala/analysis/ExprAnalyzer.java M fe/src/main/java/org/apache/impala/analysis/FunctionCallExpr.java M fe/src/main/java/org/apache/impala/common/TreeNode.java M fe/src/main/java/org/apache/impala/rewrite/BetweenToCompoundRule.java M fe/src/main/java/org/apache/impala/rewrite/EqualityDisjunctsToInRule.java M fe/src/main/java/org/apache/impala/rewrite/ExprRewriter.java M fe/src/main/java/org/apache/impala/rewrite/ExtractCommonConjunctRule.java M fe/src/main/java/org/apache/impala/rewrite/NormalizeBinaryPredicatesRule.java M fe/src/main/java/org/apache/impala/rewrite/NormalizeCountStarRule.java M fe/src/main/java/org/apache/impala/rewrite/SimplifyConditionalsRule.java M fe/src/main/java/org/apache/impala/rewrite/SimplifyDistinctFromRule.java M fe/src/test/java/org/apache/impala/analysis/ExprRewriteRulesTest.java 18 files changed, 676 insertions(+), 375 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/43/12143/1 -- To view, visit http://gerrit.cloudera.org:8080/12143 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ifda7082abea4f6448e6cfef0d9ef7b8565d73fce Gerrit-Change-Number: 12143 Gerrit-PatchSet: 1 Gerrit-Owner: Paul Rogers <prog...@cloudera.com>