impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Behm (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-4309: Introduce Expr rewrite phase and supporting classes.
Date Wed, 19 Oct 2016 23:29:47 GMT
Alex Behm has posted comments on this change.

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

Patch Set 2:

File fe/src/main/java/org/apache/impala/analysis/

PS2, Line 68: List<ExprRewriteRule> rules = Lists.newArrayList();
            :     rules.add(BetweenToCompoundRule.INSTANCE)
> I think these lines can be combined into one, Lists.newArrayList(BetweenToC
It doesn't fit into one line, so I think this version is more readable (and same number of
lines). Keep in mind that we'd need to:


PS2, Line 327: rewriteSubqueries
> IMO, the new method name is a little misleading given it is not actually pe
File fe/src/main/java/org/apache/impala/analysis/

PS2, Line 1037:  if (conjunct instanceof BetweenPredicate) {
              :           conjunct = BetweenToCompoundRule.INSTANCE.rewrite(conjunct, this);
              :         }
> Just curious why this has been added. Shouldn't it work even without it?
Added comment.

We need this because analyze() registers predicates with the Analyzer and this function is
called as part of registration. In the initial analysis pass, we haven't rewritten BetweenPredicates

This is one of the reasons why it's cleaner to also separate conjunct registration from analyze().
I have an abandoned patch for that which I might pick up later.
File fe/src/main/java/org/apache/impala/analysis/

Line 50:   public void analyze(Analyzer analyzer) throws AnalysisException {
> so nice to read the cleaned-up version :)
haha indeed!
File fe/src/main/java/org/apache/impala/analysis/

Line 88: 
> @Override for consistency
Doesn't override.
File fe/src/main/java/org/apache/impala/analysis/

Line 206:     stmt.whereClause_ = BetweenToCompoundRule.INSTANCE.rewrite(stmt.whereClause_,
> long line.
File fe/src/main/java/org/apache/impala/analysis/

Line 513: 
> @Override for consistency.
Doesn't override
File fe/src/main/java/org/apache/impala/rewrite/

Line 36:     numChanges_ = 0;
> This doesn't seem to be thread safe. Given we are using a static INSTANCE, 
Good catch, this was a straight-up bug. Fixed.

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: Alex Behm <>
Gerrit-Reviewer: Bharath Vissapragada <>
Gerrit-Reviewer: Tim Armstrong <>
Gerrit-HasComments: Yes

View raw message