impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe McDonnell (Code Review)" <ger...@cloudera.org>
Subject [Impala-ASF-CR] IMPALA-4792: Fix number of distinct values for a CASE with constant outputs
Date Wed, 01 Feb 2017 18:39:33 GMT
Joe McDonnell has posted comments on this change.

Change subject: IMPALA-4792: Fix number of distinct values for a CASE with constant outputs
......................................................................


Patch Set 3:

(3 comments)

http://gerrit.cloudera.org:8080/#/c/5768/3/fe/src/main/java/org/apache/impala/analysis/CaseExpr.java
File fe/src/main/java/org/apache/impala/analysis/CaseExpr.java:

Line 393:     long numOutputConstants = 0;
> int is fine here, if you overflow that we have other problems.
Done


Line 402:       if ((i - loopStart) % 2 == 1 || (i == children_.size() - 1 && hasElseExpr_))
{
> check the negation and continue (to save one indentation level).
Done


Line 409:             if (constLiteralSet.add(outputLiteral)) ++numOutputConstants;
> nice optimization. is there a test for that?
I hand tested it. I was looking through our tests, and it would be easy for me to add a SQL
to QueryTest/explain-level2.test to test this patch's behavior.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I21dbdaad8452b7e58c477612b47847dccd9d98d2
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Joe McDonnell <joemcdonnell@cloudera.com>
Gerrit-Reviewer: Alex Behm <alex.behm@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <joemcdonnell@cloudera.com>
Gerrit-Reviewer: Marcel Kornacker <marcel@cloudera.com>
Gerrit-HasComments: Yes

Mime
View raw message