Connect using Tableau

Hi,

Does anyone have any experience connecting to Druid using Tableau desktop?

I have followed this document here https://community.tableau.com/thread/290365

And then I try to use the model file as mention here: https://calcite.apache.org/docs/druid_adapter.html . I defined the model and safe as a file. On the Tableau login box I select the model properties file. Login is fine, but there is still no schema or table show up after I connect.

What am I missing?

Thanks.

1 Like

Hey Druider!

What version of Druid and Tableau are you using?

With Tableau 2018.3+ and Druid 0.14+ itโ€™s much easier: just use Tableauโ€™s JDBC connectivity with the Avatica jar, which you can get from here: https://search.maven.org/artifact/org.apache.calcite.avatica/avatica/1.13.0/jar and follow the instructions for JDBC on the Druid SQL page: http://druid.io/docs/latest/querying/sql

Thanks for the respond. I am using Druid 0.14 and Tableau 2019.01. Yes, I dowloaded the jar and jdbc connect. I was able to connect, but unable to see any tables. Do I need to do anything extra? Or any places I should check for the missing tables? while i use dsql, it shows all datasources and i have put all all datasources in the default druid schema.

It should work if you do the following:

  1. Enter the URL โ€œjdbc:avatica:remote:url=http://DRUID-QUERY-SERVER:8082/druid/v2/sql/avatica/โ€ (replacing DRUID-QUERY-SERVER with the hostname or IP address of your Druid query broker).

  2. Select the dialect โ€œSQL92โ€.

  3. Enter a username and password if you have enabled authentication on your Druid cluster. Otherwise, leave them blank.

  4. You can set connection context parameters through a properties file, if you like. If you do not need any special context parameters, leave this section blank.

  5. Click โ€œSign Inโ€.

  6. Choose database โ€œdruidโ€, schema โ€œdruidโ€, and then drag the table you wish to query up to the tables area and click โ€œSheet 1โ€ to open a worksheet. Joins are not supported, so only use one table at a time.

Thanks Gian. I was doing the same as you mentioned. I could login but it just does not show any database or table from selection.

If I do the dsql, it shows all tables.

\dS

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”

โ”‚ TABLE_SCHEMA โ”‚ TABLE_NAME โ”‚

โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค

โ”‚ druid โ”‚ event_stats โ”‚

โ”‚ druid โ”‚ batch_event_stats_2019_04_17_01 โ”‚

โ”‚ druid โ”‚ batch_event_stats_2019_04_17_local_01 โ”‚

โ”‚ druid โ”‚ batch_event_stats_2019_04_18_01 โ”‚

โ”‚ druid โ”‚ batch_event_stats_2019_04_18_02 โ”‚

โ”‚ druid โ”‚ CRICKET_event_stats โ”‚

โ”‚ INFORMATION_SCHEMA โ”‚ COLUMNS โ”‚

โ”‚ INFORMATION_SCHEMA โ”‚ SCHEMATA โ”‚

โ”‚ INFORMATION_SCHEMA โ”‚ TABLES โ”‚

โ”‚ sys โ”‚ segments โ”‚

โ”‚ sys โ”‚ server_segments โ”‚

โ”‚ sys โ”‚ servers โ”‚

โ”‚ sys โ”‚ tasks โ”‚

โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Retrieved 13 rows in 0.02s.

Here is what I found from the broker log:

2019-04-29T18:39:07,835 ERROR [qtp1657920572-112] org.apache.calcite.runtime.CalciteException - org.apache.calcite.sql.validate.SqlValidatorException: Ordinal out of range

2019-04-29T18:39:07,836 ERROR [qtp1657920572-112] org.apache.calcite.runtime.CalciteException - org.apache.calcite.runtime.CalciteContextException: At line 5, column 10: Ordinal out of range

I think this is probably the issue why the database is not found. I will look for an answer.

I found I was wrong about my druid distribution. It was 0.13.0. Not 0.14.0. After I upgraded to the newer version. I am able to connect to Tableau and see all the tables in the druid schema.