Alex Behm 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 3: (1 comment) 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: if (distinctAggExprs.get(i).getFnName().getFunction().equalsIgnoreCase( : "count")) { > 1. Do you mean the guidance of NDV is also printed on your example? Why sho In my example, it does not make sense to print an error message that uses NDV() on a specific child of an existing aggregate function like in your current error message. I see two options: (1) Only print the NDV() recommendation if one of the distinctAggExprs is a COUNT(). Give a specific recommendation which aggregate expr to rewrite. (2) Always print the NDV() workaround using a generic error message like the one I proposed I don't like option (1) because even if you convert all COUNT(DISTINCT) to NDV() you might still not be able to run the query. Example: select count(distinct a), count(distinct b), avg(distinct c), avg(distinct d) ... -- 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: 3 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 06:02:14 +0000 Gerrit-HasComments: Yes