How to use HLLSketch in jdbc?

How to use HLLSketch in jdbc?

useApproximateCountDistinct=true is not working.

I got error like this

“expected a HyperUnique, got a class com.yahoo.sketches.hll.HllSketch”

Thanks

Hey Jay,

Try APPROX_COUNT_DISTINCT_DS_HLL instead. (See https://druid.apache.org/docs/latest/querying/sql for reference)

Hi Gian.

I’m using tableau via jdbc now so I can’t modify distinct count query.

Only option I can do is set useApproximateCountDistinct=true in jdbc setting.

How can I use hllsketch in tableau? (hyperUnique is works well)

Jay

Hi Jay,

You can use “RAWSQLAGG_REAL” functions of Tableau.

Ex: to compute approx count distinct of customerID you can use expression RAWSQLAGG_REAL(“APPROX_COUNT_DISTINCT_DS_THETA(%1)”, [customerID])

Tableau supports variants of RAWSQL function - to compute agg metric or dimension (custom sql expression).

You can refer to post https://groups.google.com/forum/#!topic/druid-user/DejxkN4Aiz4

Hope this helps.

Regards, Chari.