Skip to main content

Tableau

VeloDB provides an official Tableau Doris connector. This connector accesses data based on the MySQL JDBC Driver.

The connector has been tested by the TDVT framework with a 100% pass rate.

With this connector, Tableau can integrate Apache Doris databases and tables as data sources. To enable this, follow the setup guide below:

  • Install Tableau and the Doris connector
  • Configure an Apache Doris data source in Tableau
  • Build visualizations in Tableau
  • Connection and usage tips
  • Summary

Install Tableau and Doris connector

  1. Download and install Tableau desktop.
  2. Get the tableau-doris custom connector connector (doris_jdbc-***.taco).
  3. Get MySQL JDBC (version 8.3.0).
  4. Locations to place the Connector and JDBC driver MacOS:
    • Refer to this path: ~/Documents/My Tableau Repository/Connectors, place the doris_jdbc-latest.taco custom connector file (if the path does not exist, create it manually as needed).
    • JDBC driver jar placement path: ~/Library/Tableau/Drivers Windows: Assume tableau_path is the Tableau installation directory on Windows, typically defaults to: tableau_path = C:\Program Files\Tableau
    • Refer to this path: %tableau_path%``\Connectors\, place the doris_jdbc-latest.taco custom connector file (if the path does not exist, create it manually as needed).
    • JDBC driver jar placement path: %tableau_path%\Drivers\

Next, you can configure a Doris data source in Tableau and start building data visualizations!

Configure a Doris data source in Tableau

Now that you have installed and set up the JDBC and Connector drivers, let's look at how to define a data source in Tableau that connects to the tpch database in Doris.

  1. Gather your connection details

To connect to Apache Doris via JDBC, you need the following information:

ParameterMeaningExample
ServerDatabase host127.0.1.28
PortDatabase MySQL port9030
CatalogDoris Catalog, used when querying external tables and data lakes, set in Advancedinternal
DatabaseDatabase nametpch
AuthenticationChoose database authentication method: Username / Username and PasswordUsername and Password
UsernameUsernametestuser
PasswordPasswordLeave blank
Init SQL StatementInitial SQL statementselect * from database.table
  1. Launch Tableau. (If you were already running it before placing the connector, please restart.)
  2. From the left menu, click More under the To a Server section. In the list of available connectors, search for Doris JDBC by VeloDB:

  1. Click Doris by VeloDB ,the following dialog will pop up:

  1. Enter the corresponding connection information as prompted in the dialog.

  2. Optional advanced configuration:

    • You can enter preset SQL in Initial SQL to define the data source
    • In Advanced, you can use Catalog to access data lake data sources; the default value is internal,
  3. After completing the above input fields, click the Sign In button, and you should see a new Tableau workbook:

Next, you can build some visualizations in Tableau!

Build visualizations in Tableau

We choose TPC-H data as the data source, refer to this document for the construction method of the Doris TPC-H data source

Now that we have configured the Doris data source in Tableau, let's visualize the data

  1. Drag the customer table and orders table to the workbook. And select the table join field Custkey for them below

  1. Drag the nation table to the workbook and select the table join field Nationkey with the customer table
  2. Now that you have associated the customer table, orders table and nation table as a data source, you can use this relationship to handle questions about the data. Select the Sheet 1 tab at the bottom of the workbook to enter the workspace.
  3. Suppose you want to know the summary of the number of users per year. Drag OrderDate from orders to the Columns area (horizontal field), and then drag customer(count) from customer to Rows. Tableau will generate the following line chart:

A simple line chart is completed, but this dataset is automatically generated by the tpch script and default rules and is not actual data. It is not for reference and is intended to test availability.

  1. Suppose you want to know the average order amount (USD) by region (country) and year:
    • Click the New Worksheet tab to create a new sheet
    • Drag Name from the nation table to Rows
    • Drag OrderDate from the orders table to Columns

You should see the following:

  1. Note: The Abc value is just a placeholder value, because you have not defined aggregation logic for that mark, so you need to drag a measure onto the table. Drag Totalprice from the orders table to the middle of the table. Note that the default calculation is to perform a SUM on Totalprices:
  2. Click SUM and change Measure to Average.
  3. From the same dropdown menu, select Format and change Numbers to Currency (Standard):
  4. Get a table that meets expectations:

So far, Tableau has been successfully connected to Apache Doris, and data analysis and visualization dashboard production has been achieved.

Connection and usage tips

Performance optimization

  • According to actual needs, reasonably create doris databases and tables, partition and bucket by time, which can effectively reduce predicate filtering and most data transmission
  • Appropriate data pre-aggregation can be done by creating materialized views on the Doris side.
  • Set a reasonable refresh plan to balance the computing resource consumption of refresh and the timeliness of dashboard data

Security configuration

  • It is recommended to use VPC private connections to avoid security risks introduced by public network access.
  • Configure security groups to restrict access.
  • Enable access methods such as SSL/TLS connections.
  • Refine Doris user account roles and access permissions to avoid excessive delegation of permissions.

Summary

This connector simplifies the connection setup process of generic ODBC/JDBC driver-based connectors and provides a better compatible connector for Apache Doris. If you encounter any problems when using the connector, please feel free to contact us on GitHub.