Kim Jin Chul has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/8614 )

Change subject: IMPALA-2250: Make multiple COUNT(DISTINCT) message state 
workarounds
......................................................................


Patch Set 2:

(3 comments)

http://gerrit.cloudera.org:8080/#/c/8614/2/fe/src/main/java/org/apache/impala/analysis/AggregateInfo.java
File fe/src/main/java/org/apache/impala/analysis/AggregateInfo.java:

http://gerrit.cloudera.org:8080/#/c/8614/2/fe/src/main/java/org/apache/impala/analysis/AggregateInfo.java@250
PS2, Line 250:             + "Replace " + distinctAggExprs.get(0).toSql()
> * Just replacing one function may not work, so suggesting to replace a sing
Please see : 
https://gerrit.cloudera.org/#/c/8614/3/fe/src/main/java/org/apache/impala/analysis/AggregateInfo.java


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

http://gerrit.cloudera.org:8080/#/c/8614/3/fe/src/main/java/org/apache/impala/analysis/AggregateInfo.java@249
PS3, Line 249:             + "; deviating function: " + 
distinctAggExprs.get(i).toSql() + "\n"
             :             + "Replace
Conversion to NDV() is only available for the case: COUNT(DISTINCT).


http://gerrit.cloudera.org:8080/#/c/8614/3/fe/src/main/java/org/apache/impala/analysis/AggregateInfo.java@252
PS3, Line 252:             + ") if estimated counts are okay. Enable the 
APPX_COUNT_DISTINCT"
             :             + " query option to perform this rewrite 
automatically.");
I think it is better to show a specific object instead of constant.
Do you still prefer the constant general string like COUNT(DISTINCT)?

> select count(distinct x), count(distinct y), count(distinct z) from t3;
ERROR: AnalysisException: All DISTINCT aggregate functions need to have the 
same set of parameters as count(DISTINCT x); deviating function: count(DISTINCT 
y)
Consider using NDV(y) instead of count(DISTINCT y) if estimated counts are 
acceptable. Enable the APPX_COUNT_DISTINCT query option to perform this rewrite 
automatically.

> select count(distinct x), ndv(distinct y), count(distinct z) from t3;
ERROR: AnalysisException: All DISTINCT aggregate functions need to have the 
same set of parameters as count(DISTINCT x); deviating function: count(DISTINCT 
z)
Consider using NDV(z) instead of count(DISTINCT z) if estimated counts are 
acceptable. Enable the APPX_COUNT_DISTINCT query option to perform this rewrite 
automatically.

> select count(distinct x), ndv(distinct y), ndv(distinct z) from t3;
--> works



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I5084be10946d68f3ec0760c2b7e698635df26a89
Gerrit-Change-Number: 8614
Gerrit-PatchSet: 2
Gerrit-Owner: Kim Jin Chul <jinc...@gmail.com>
Gerrit-Reviewer: Alex Behm <alex.b...@cloudera.com>
Gerrit-Reviewer: Kim Jin Chul <jinc...@gmail.com>
Gerrit-Comment-Date: Wed, 22 Nov 2017 05:20:08 +0000
Gerrit-HasComments: Yes

Reply via email to