Druid has a column type hyperUnique that can be used in COUNT(DISTINCT $expr). I added a mapping between the column type so it shows up as a BLOB in SQLAlchemy.
I tested the code by running a query on a hyperUnique column, session_id:
from sqlalchemy.engine import create_engine
engine = create_engine('druid+https://XXXXXXXXXX:443/druid/v2/sql/')
with engine.connect() as conn:
res = conn.execute('SELECT COUNT(DISTINCT session_id) AS sessions FROM hive_query_logged')
print(list(res))
Thanks for this fix! When do you plan to release new version? This issue is a root cause that Superset is not able to fetch metadata for tables with hyperUnique columns.
Druid has a column type
hyperUnique
that can be used inCOUNT(DISTINCT $expr)
. I added a mapping between the column type so it shows up as aBLOB
in SQLAlchemy.I tested the code by running a query on a
hyperUnique
column,session_id
: