Skip to main content

Tableau

For enabling Apache Doris access on Tableau, Tableau's official MySQL connector can meet your needs. This connector uses the MySQL JDBC driver to access data.

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

  • Required setup before use
  • Configuring the Apache Doris data source in Tableau
  • Building visualizations in Tableau
  • Connection and usage tips

Installing Tableau and the JDBC driver

  1. Download and install Tableau desktop.
  2. Obtain MySQL JDBC (version 8.3.0).
  3. JDBC Driver Placement Path
    • macOS: JDBC driver JAR file placement path: ~/Library/Tableau/Drivers
    • Windows: Assuming tableau_path is the Tableau installation directory on the Windows operating system, generally the default is: tableau_path = C:\Program Files\Tableau, then the JDBC driver JAR file placement path is: %tableau_path%\Drivers\

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

Configuring a Doris Data Source in Tableau

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

  1. Gathering Your Connection Details

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

ParameterMeaningExample
ServerDatabase host127.0.1.28
PortDatabase MySQL port9030
DatabaseDatabase nametpch
UsernameUsernametestuser
PasswordPasswordLeave blank
Init SQL StatementInitial SQL statementselect * from database.table
  1. Start Tableau. (If you are already running it, please restart it.)
  2. From the left-hand menu, click More under the To a Server section. Search for mysql in the list of available connectors.

  1. Clicking MySQL will bring up the following dialog box:

  1. Follow the prompts in the dialog box to enter the corresponding connection information.
  2. After completing the above input boxes, click the Sign In button. You should then see a new Tableau workbook.

Next, we can build some visualizations in Tableau!

Building Visualizations in Tableau

We've chosen TPC-H data as our data source. For instructions on building a Doris TPC-H data source, refer to this document.

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

  1. Drag the customer and orders tables into the workbook. Then, select the Custkey field for the table association below.
  2. Drag the nation table into the workbook and associate it with the customer table by selecting the Nationkey field.
  3. Now you have linked the customer, orders, and nation tables as data sources, so you can use this relationship to work on data-related issues. Select the Sheet 1 tab at the bottom of the workbook to access the workbench.
  4. Suppose you want to know the total number of users each year. Drag OrderDate from orders to the Columns area (a horizontal field), and then drag customer(count) from customer to Rows. Tableau will generate the following line chart:

A simple line chart is now complete. However, this dataset is not real data and was automatically generated by the tpch script and default rules; it is intended for testing usability.

  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 table
    • Drag Name from the nation table into Rows
    • Drag OrderDate from the orders table into Columns

You should see the following:

  1. Note: The Abc value is just a populated value because you haven't defined the aggregation logic to this icon, so you need to drag the measure onto the table. Drag Totalprice from the orders table to the middle of the table. Note that the default calculation is a SUM on Totalprices:
  2. Click SUM and change Measure to Average.
  3. From the same drop-down menu, select Format and change Numbers to Currency (Standard)
  4. You will get a table that meets your expectations.

At this point, Tableau has been successfully connected to Apache Doris, enabling data analysis and dashboard creation.

Connection and Usage Tips

Performance Optimization

  • Create Doris database tables appropriately based on actual needs, partitioning and bucketing by time to effectively reduce predicate filtering and most data transfer.
  • Appropriate data pre-aggregation can be achieved by creating materialized views on the Doris side.
  • Set a reasonable refresh schedule to balance refresh computational resource consumption and dashboard data timeliness.

Security Configuration

  • It is recommended to use a VPC private connection to avoid security risks introduced by public network access.
  • Configure security groups to restrict access.
  • Enable SSL/TLS connections and other access methods.
  • Fine-tune Doris user account roles and access permissions to avoid excessive delegation of permissions.