impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Armstrong (Code Review)" <ger...@cloudera.org>
Subject [Impala-ASF-CR] IMPALA-4309: Introduce Expr rewrite phase and supporting classes.
Date Wed, 19 Oct 2016 20:31:27 GMT
Tim Armstrong has posted comments on this change.

Change subject: IMPALA-4309: Introduce Expr rewrite phase and supporting classes.
......................................................................


Patch Set 2:

(5 comments)

The overall approach looks sane - had a few high-level questions/comments.

http://gerrit.cloudera.org:8080/#/c/4746/2/fe/src/main/java/org/apache/impala/analysis/BetweenPredicate.java
File fe/src/main/java/org/apache/impala/analysis/BetweenPredicate.java:

PS2, Line 26: becuase
because


http://gerrit.cloudera.org:8080/#/c/4746/2/fe/src/main/java/org/apache/impala/rewrite/BetweenToCompoundRule.java
File fe/src/main/java/org/apache/impala/rewrite/BetweenToCompoundRule.java:

Line 29:  * Rewrites BetweenPredicates a conjunctive/disjunctive CompoundPredicate.
This sentence has some grammatical issues.


Line 40:   private Expr rewriteImpl(Expr expr, Analyzer analyzer) throws AnalysisException
{
Maybe rewriteRecursive? Unless there's an existing convention to use Impl for functions like
this.


http://gerrit.cloudera.org:8080/#/c/4746/2/fe/src/main/java/org/apache/impala/rewrite/ExprRewriteRule.java
File fe/src/main/java/org/apache/impala/rewrite/ExprRewriteRule.java:

Line 36:    * transformed Expr. The returned Expr is analyzed.
Is this called for the top level of each expression tree, or for each subexpression?


http://gerrit.cloudera.org:8080/#/c/4746/2/fe/src/test/java/org/apache/impala/analysis/ExprRewriterTest.java
File fe/src/test/java/org/apache/impala/analysis/ExprRewriterTest.java:

Line 60:   public AnalysisContext RewritesOk(String stmt, int expectedRewriteCount) {
It would also be helpful to test that the expressions are actually replaced with the new ones.
E.g. I can imagine bugs where rewrite() is called but its return value is dropped on the floor.

Maybe you could rewrite the expression into something trivial to confirm. E.g. a numeric literal?


-- 
To view, visit http://gerrit.cloudera.org:8080/4746
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I2279dc984bcf7742db4fa3b1aa67283ecbb05e6e
Gerrit-PatchSet: 2
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Alex Behm <alex.behm@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <tarmstrong@cloudera.com>
Gerrit-HasComments: Yes

Mime
View raw message