impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Armstrong (Code Review)" <>
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:


The overall approach looks sane - had a few high-level questions/comments.
File fe/src/main/java/org/apache/impala/analysis/

PS2, Line 26: becuase
File fe/src/main/java/org/apache/impala/rewrite/

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
File fe/src/main/java/org/apache/impala/rewrite/

Line 36:    * transformed Expr. The returned Expr is analyzed.
Is this called for the top level of each expression tree, or for each subexpression?
File fe/src/test/java/org/apache/impala/analysis/

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
To unsubscribe, visit

Gerrit-MessageType: comment
Gerrit-Change-Id: I2279dc984bcf7742db4fa3b1aa67283ecbb05e6e
Gerrit-PatchSet: 2
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Alex Behm <>
Gerrit-Reviewer: Tim Armstrong <>
Gerrit-HasComments: Yes

View raw message