ClickHouse / clickhouse-tableau-connector-jdbc

Tableau connector to ClickHouse using JDBC driver
Apache License 2.0
57 stars 9 forks source link

ClickHouse Tableau JDBC connector

Intro

This is an extension for Tableau Desktop / Tableau Server that simplifies the process of connecting Tableau to ClickHouse and extends support for standard Tableau functionality when working with ClickHouse (as compared to Generic ODBC/JDBC)

Features

Before you install

Requirements

Installation (Tableau Desktop)

  1. Download the Clickhouse JDBC Driver (version 0.4.6 required), and place the clickhouse-jdbc-0.4.6-shaded.jar to:
    • macOS: ~/Library/Tableau/Drivers
    • Windows: C:\Program Files\Tableau\Drivers
    • You need to create the folder if it doesn't already exist
  2. Download the latest clickhouse-jdbc.taco from the Releases page, and place it to:
    • macOS: ~/Documents/My Tableau Repository/Connectors
    • Windows: C:\Users\[Windows User]\Documents\My Tableau Repository\Connectors
  3. Run Tableau Desktop
  4. In Tableau Desktop: ConnectTo a ServerClickHouse JDBC by ClickHouse, Inc.

Installation (Tableau Prep Builder)

  1. Download the Clickhouse JDBC Driver (version 0.4.6 required) and place the clickhouse-jdbc-0.4.6-shaded.jar to:
    • macOS: ~/Library/Tableau/Drivers
    • Windows: C:\Program Files\Tableau\Drivers
    • You need to create the folder if it doesn't already exist
  2. Download the latest clickhouse-jdbc.taco from the Releases page and place it to:
    • macOS: ~/Documents/My Tableau Prep Repository/Connectors
    • Windows: C:\Users\[Windows User]\Documents\My Tableau Prep Repository\Connectors
  3. Run Tableau Prep Builder
  4. In Tableau Prep Builder: Connections+To a ServerClickHouse JDBC by ClickHouse, Inc.

Installation (Tableau Server)

  1. Download the Clickhouse JDBC Driver (version 0.4.6 required) and place the clickhouse-jdbc-0.4.6-shaded.jar to:
    • Linux: /opt/tableau/tableau_driver/jdbc
    • Windows: C:\Program Files\Tableau\Drivers
    • You need to create the directory if it doesn't already exist
    • For Linux: make sure directory is readable by the "tableau" user. To do this:
      • Create the directory:
        sudo mkdir -p /opt/tableau/tableau_driver/jdbc
      • Copy the downloaded driver file to the location, replacing [/path/to/file] with the path and [driver file name] with the name of the driver you downloaded:
        sudo cp [/path/to/file/][driver file name].jar /opt/tableau/tableau_driver/jdbc
      • Set permissions so the file is readable by the "tableau" user, replacing [driver file name] with the name of the driver you downloaded:
        sudo chmod 755 /opt/tableau/tableau_driver/jdbc/[driver file name].jar
  2. Download the latest clickhouse-jdbc.taco from the Releases page and place it into these folders on each node:
    • Linux: /opt/tableau/connectors
    • Windows: C:\Program Files\Tableau\Connectors
  3. Restart the server.
    tsm restart
    • Note that whenever you add, remove, or update a connector, you need to restart the server to see the changes.

      Connection tips

      Initial SQL tab

      If the Set Session ID checkbox is activated on the Advanced tab (by default), feel free to set session level settings using

      SET my_setting=value;

      Advanced tab

      In 99% of cases you don't need the Advanced tab, for the remaining 1% you can use the following settings:

    • Custom Connection Parameters. By default, socket_timeout is already specified, this parameter may need to be changed if some extracts are updated for a very long time. The value of this parameter is specified in milliseconds. The rest of the parameters can be found here, add them in this field separated by commas
    • JDBC Driver custom_http_params. This field allows you to drop some parameters into the ClickHouse connection string by passing values to the custom_http_params parameter of the driver. For example, this is how session_id is specified when the Set Session ID checkbox is activated
    • JDBC Driver typeMappings. This field allows you to pass a list of ClickHouse data type mappings to Java data types used by the JDBC driver. The connector automatically displays large Integers as strings thanks to this parameter, you can change this by passing your mapping set (I do not know why) using
      UInt256=java.lang.Double,Int256=java.lang.Double

      Read more about mapping in the corresponding section

Future plans

Tests

The connector is being tested with the TDVT framework and currently maintains a 97% coverage ratio.

Acknowledgement

Originally developed by ANALYTIKA PLUS