Druid QL error for multiple COUNT(DISTINCT <dimension>)) in SELECT statement

Hi,

On version 0.14.2-incubating we were able to do this query:

SELECT SUM(bytesOut) AS sum_bytesOut,
SUM(bytesIn) AS sum_bytesIn,
SUM(“count”) AS sum_count,
COUNT(distinct sourceIP) AS distinctCount_sourceIP,
COUNT(distinct destIP) AS distinctCount_destIP,
location
FROM “augmented-data”
WHERE __time BETWEEN TIMESTAMP ‘2020-05-24 16:00:00’ AND TIMESTAMP ‘2020-05-26 17:59:00’
AND parentAccountId = ‘1-XXXXX’
GROUP BY location

But when upgrading to 0.16.0-incubating the 2nd highlighted COUNT(DISTINCT ) expression gives off an error:

Unknown exception / Cannot build plan for query: SELECT * FROM (SELECT SUM(bytesOut) AS sum_bytesOut, SUM(bytesIn) AS sum_bytesIn, SUM(“count”) AS sum_count, COUNT(distinct sourceIP) AS distinctCount_sourceIP, COUNT(distinct destIP) AS distinctCount_destIP, locationFROM “augmented-data” WHERE __time BETWEEN TIMESTAMP ‘2020-05-24 16:00:00’ AND TIMESTAMP ‘2020-05-26 17:59:00’ AND parentAccountId = ‘1-XXXXX’ GROUP BY location) LIMIT 100 / org.apache.druid.java.util.common.ISE

We also upgraded to version 0.18.1 thinking that it was limited to the 0.16.0 version but it also had the same error.

Any idea what might be causing this?

Thanks,
Raf

Check this page:
https://druid.apache.org/docs/latest/querying/sql

Look for useApproximateCountDistinct