impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bharath Vissapragada (Code Review)" <ger...@cloudera.org>
Subject [Impala-ASF-CR] IMPALA-1861: Simplify conditionals with constant conditions
Date Sat, 14 Jan 2017 00:22:02 GMT
Bharath Vissapragada has posted comments on this change.

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


Patch Set 10: Code-Review+1

(3 comments)

The patch looks good to me overall. Especially the logic in SimplifyConditionalsRule.simplifyCaseExpr()
looks good to me as per ANSI SQL standard.

http://gerrit.cloudera.org:8080/#/c/5585/10/fe/src/main/java/org/apache/impala/analysis/AnalysisContext.java
File fe/src/main/java/org/apache/impala/analysis/AnalysisContext.java:

Line 39: import org.apache.impala.rewrite.SimplifyConditionalsRule;
nit: Move below to maintain lexicographical order.


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

Line 38:     if (!expr.isAnalyzed()) return expr;
nit: I think this can be rewritten as below to avoid nesting.

 if (!expr.isAnalyzed() || !(expr instanceof CompoundPredicate)) return expr;
 return normalizeCompoundPredicate((CompoundPredicate) expr);


Line 43: 
nit: Extraneous newline (here and elsewhere in this patch).


-- 
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: 10
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Thomas Tauber-Marshall <tmarshall@cloudera.com>
Gerrit-Reviewer: Alex Behm <alex.behm@cloudera.com>
Gerrit-Reviewer: Bharath Vissapragada <bharathv@cloudera.com>
Gerrit-Reviewer: Marcel Kornacker <marcel@cloudera.com>
Gerrit-Reviewer: Thomas Tauber-Marshall <tmarshall@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <tarmstrong@cloudera.com>
Gerrit-HasComments: Yes

Mime
View raw message