Thomas Tauber-Marshall has posted comments on this change.

Change subject: IMPALA-1861: Simplify conditionals with constant conditions
......................................................................


Patch Set 5:

(6 comments)

http://gerrit.cloudera.org:8080/#/c/5585/4/fe/src/main/java/org/apache/impala/rewrite/NormalizeExprsRule.java
File fe/src/main/java/org/apache/impala/rewrite/NormalizeExprsRule.java:

Line 50:     if (!(expr.getChild(0) instanceof BoolLiteral)
> why is isLiteral() not enough? (what other literal could it be?)
NullLiteral, so if we just called isLiteral() something like "NULL || TRUE" 
wouldn't get simplified to "TRUE", since it wouldn't be rewritten by this rule, 
and then SimplifyConstantConditionals wouldn't simplify it either since it 
doesn't have a BoolLiteral left child.


http://gerrit.cloudera.org:8080/#/c/5585/3/fe/src/main/java/org/apache/impala/rewrite/SimplifyConditionalsRule.java
File fe/src/main/java/org/apache/impala/rewrite/SimplifyConditionalsRule.java:

Line 65:   /**
> then spell this out in a todo
Done


Line 132:    * 'then' for the first one is returned. Otherwise, if any of the 
'when's have constant
> i don't think it'll have any measurable impact on runtime, and the code won
It turned out to be pretty simple, so I went for it.


http://gerrit.cloudera.org:8080/#/c/5585/4/fe/src/main/java/org/apache/impala/rewrite/SimplifyConditionalsRule.java
File fe/src/main/java/org/apache/impala/rewrite/SimplifyConditionalsRule.java:

Line 91:   /**
> spell out rule dependencies in the class comment (and also in analysisctx w
Done


Line 143:     boolean canSimplify = false;
> 'simplified' -> 'removed' (even more specific)
Done


Line 148:       }
> why don't you do
Done


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Id70aaf9fd99f64bd98175b7e2dbba28f350e7d3b
Gerrit-PatchSet: 5
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Thomas Tauber-Marshall <[email protected]>
Gerrit-Reviewer: Alex Behm <[email protected]>
Gerrit-Reviewer: Marcel Kornacker <[email protected]>
Gerrit-Reviewer: Thomas Tauber-Marshall <[email protected]>
Gerrit-HasComments: Yes

Reply via email to