Add a druid cluster as a SQL database in Apache Superset
Asked Answered
W

2

10

I currently connect to the druid cluster through the druid connector in Apache Superset. I heard that SQL can be used to query druid. Is it possible to point my SQL database connection to druid?

Wisdom answered 4/5, 2018 at 20:16 Comment(0)
L
17

Follow the steps below

  1. You need to use latest version of pydruid for enabling sqlalchemy support. For me pydruid 0.4.1 is working fine.

  2. On Superset, in the Databases section you need to provide the SQLAlchemy URI druid://XX.XX:8082/druid/v2/sql/using a broker ip/host.

  3. Third thing you need to do is to enable druid.sql.enable=true on broker.

I hope this will help you.

Lemuel answered 10/5, 2018 at 13:41 Comment(6)
Sweet, I will try this out. Getting the enable piece may take a bit. I will accept your answer once I am able to fully test it.Wisdom
It is in the Databases section under Sources, and not Datasources (which is also present, but it's not what you'd want).Locale
@JohnStrood Thanks John. I have made the changes.Lemuel
I tried HDP 2.6.5 with pydruid 0.4.5 installed then restarted superset, but still has "Can't load plugin: sqlalchemy.dialects:druid" error,why?Translocation
I recently faced the same problem and this answer helped me. One thing to add, I don't know if this is new since this question was asked a year ago. You'd need to enable Expose in SQL Lab now in when you add source->databasesEcker
And if you have basic auth setup you can also use the form: druid://admin:pass@druid-host:8082/druid/v2/sql/Strow
S
5

i was really struggling with this one... in my case, i am running on my mac. druid is installed directly and superset is running in docker (using the docker-compose setup).

the key is that localhost in the superset docker container doesn't point at the host, but instead at the docker container.

when i changed the superset datasource to this, it worked...

druid://host.docker.internal:8082/druid/v2/sql/
Salamis answered 10/3, 2020 at 9:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.