[druid-user] HLL datasketch in joins

Hi,

I ran into issues with HLL datasketch when combined with joins / with clause.
Consider a table t with user_id on org.apache.datasketches.hll.HllSketch, I can query
with t as (select * from t)
select APPROX_COUNT_DISTINCT_DS_HLL(user_id) from t
But when it is join’d to another table
with t as (select * from t)
select APPROX_COUNT_DISTINCT_DS_HLL(user_id) from t

inner join d on t.c1=d.c1
I got the following error:

Error: Unknown exception

[B cannot be cast to org.apache.datasketches.hll.HllSketch

java.lang.ClassCastException

If I remove the with clause, it works.

Is this a Druid bug?

Thanks,

Dong

It might be. You say user_id is theta_sketch? I tried something similar with regular columns, and it worked fine.
I also tried with theta sketches (and APPROX_COUNT_DISTINCT_DS_THETA) and that worked as well. I’ll
have to ingest some HLL sketches and try.

This worked for me, where m7_int1_sketch is an HLL sketch. (Also tried earlier with theta sketch or regular columns._

with t1 as (select * from wikipedia)
select APPROX_COUNT_DISTINCT_DS_THETA(m7_int1_sketch)
from t1
join dataTest2
on t1.“count”=m1_int1_min

What version of druid are you using, and do you have anything set in the query context?