This message was deleted.
# troubleshooting
s
This message was deleted.
n
try
Copy code
select count(distinct item, year, location) from tableA
s
gives an runtime exception
a
You can try this
Copy code
SELECT COUNT(DISTINCT ARRAY[item, year, location]) from tableA
it seems that we currently don't support using multiple fields in a approximate count aggregation via SQL.
s
oh okay so then Native query is the only option
n
CardinalityAggregatorFactory accepts multiple fields already. It seemed trivial to support that in SQL.
a
yeah. It would need changes in
BuiltinApproxCountDistinctSqlAggregator
I will put up a PR soon.
👍 3
need a bit of polishing
g
in the meantime, you can also use concat like
APPROX_COUNT_DISTINCT_DS_HLL(item || year || location)
or get fancy with separators
APPROX_COUNT_DISTINCT_DS_HLL(item || ':' || year || ':' || location)
It's not as fast as the native option (it has to actually compute the concatted string) but it would work
s
Thanks @Gian Merlino. the reason i am doing this is to get approx count of the records i will be reading in my application before actually firing the actual query so that i can limit the data if needed. i am sticking to the Native query as response time is a important factor. Do you think this is the right way to go for getting the approx count of the query before actually firing the query ?