|
| 1 | +(tableau-tutorial)= |
| 2 | +# Using CrateDB with Tableau |
| 3 | + |
| 4 | +For using Tableau with CrateDB, install the latest PostgreSQL driver, as detailed in the steps below. |
| 5 | + |
| 6 | +1. Download the Java 8 JDBC driver (e.g. `postgresql-42.7.1.jar` or newer) from https://jdbc.postgresql.org/download/. |
| 7 | +2. Move the downloaded `.jar`-file (e.g. `postgresql-42.7.1.jar`) into the Tableau Driver folder. |
| 8 | + > * **Windows**: `C:\Program Files\Tableau\Drivers` |
| 9 | + > * **Mac**: `~/Library/Tableau/Drivers` |
| 10 | + > * **Linux**: `/opt/tableau/tableau_driver/jdbc` |
| 11 | +3. Open Tableau. |
| 12 | +4. Create a `PostgreSQL` connection. |
| 13 | + |
| 14 | + {height=500px} |
| 15 | +5. Start using Tableau with CrateDB. |
| 16 | + |
| 17 | +## Using Tableau with CrateDB 5.1 and earlier |
| 18 | +::::{dropdown} **Details** |
| 19 | + |
| 20 | +As of CrateDB 5.0.0 there are still some features missing to directly |
| 21 | +use the default PostgreSQL Connector in CrateDB (e.g. `DECLARE CURSOR` support). |
| 22 | +Therefore, it is best to use a `Other Databases (JDBC)` connection with the |
| 23 | +latest PostgreSQL JDBC Driver. To improve the user experience Tableau allows |
| 24 | +to customize connections using `.tdc` (Tableau Datasource Customization) files. |
| 25 | + |
| 26 | +If we see significant demand, we might look into creating a custom Tableau Connector, |
| 27 | +however we also expect CrateDB to be fully compatible with the default PostgreSQL |
| 28 | +Connector soon. |
| 29 | + |
| 30 | +## Customize CrateDB Connection |
| 31 | + |
| 32 | +1. Download the [latest PostgreSQL JDBC Driver](https://jdbc.postgresql.org/download/) |
| 33 | +2. Move the downloaded `.jar`-file (e.g. `postgresql-42.4.1.jar`) into the Tableau Driver folder |
| 34 | + > * **Windows**: `C:\Program Files\Tableau\Drivers` |
| 35 | + > * **Mac**: `~/Library/Tableau/Drivers` |
| 36 | + > * **Linux**: `/opt/tableau/tableau_driver/jdbc` |
| 37 | + > |
| 38 | + > *also see https://help.tableau.com/current/pro/desktop/en-us/examples_otherdatabases_jdbc.htm* |
| 39 | +3. Create an empty [.tdc](https://help.tableau.com/current/pro/desktop/en-us/connect_customize.htm) (Tableau Datasource Customization) file e.g. `crate-jdbc.tdc` |
| 40 | +4. Copy the following content into the file: |
| 41 | + ```xml |
| 42 | + <connection-customization class='genericjdbc' enabled='true' version='10.0'> |
| 43 | + <vendor name='genericjdbc' /> |
| 44 | + <driver name='postgresql' /> |
| 45 | + <customizations> |
| 46 | + <customization name='CAP_CONNECT_STORED_PROCEDURE' value='no'/> |
| 47 | + <customization name='CAP_CREATE_TEMP_TABLES' value='no'/> |
| 48 | + <customization name='CAP_FAST_METADATA' value='yes'/> |
| 49 | + <customization name="CAP_FORCE_COUNT_FOR_NUMBEROFRECORDS" value="yes"/> |
| 50 | + <customization name='CAP_JDBC_QUERY_ASYNC' value='yes'/> |
| 51 | + <customization name='CAP_JDBC_QUERY_CANCEL' value='yes'/> |
| 52 | + <customization name='CAP_QUERY_HAVING_REQUIRES_GROUP_BY' value='no'/> |
| 53 | + <customization name="CAP_QUERY_SUBQUERIES_WITH_TOP" value="yes"/> |
| 54 | + <customization name="CAP_QUERY_TOP_N" value="yes"/> |
| 55 | + <customization name='CAP_QUERY_TOPSTYLE_LIMIT' value='yes'/> |
| 56 | + <customization name='CAP_SELECT_INTO' value='no'/> |
| 57 | + <customization name='CAP_SUPPRESS_TEMP_TABLE_CHECKS' value='yes'/> |
| 58 | + </customizations> |
| 59 | + </connection-customization> |
| 60 | + ``` |
| 61 | +5. Save the `.tdc-file` in your `Datasources` folder (e.g. `/Users/<username>/Documents/My Tableau Repository/Datasources/crate-jdbc.tdc` |
| 62 | +6. Open Tableau |
| 63 | +7. Create an `Other Databases (JDBC)` connection |
| 64 | + > **URL**: jdbc:postgresql://localhost:5432/doc |
| 65 | + > **Dialect**: PostgreSQL |
| 66 | + > **Username**: crate |
| 67 | + > **Password**: |
| 68 | +8. Start using Tableau with CrateDB :) |
| 69 | + |
| 70 | +:::: |
0 commit comments