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
- Download and install Tableau desktop.
- Get the tableau-doris custom connector connector (doris_jdbc-***.taco).
- Get MySQL JDBC (version 8.3.0).
- Locations to place the Connector and JDBC driver
MacOS:
- Refer to this path:
~/Documents/My Tableau Repository/Connectors
, place thedoris_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: Assumetableau_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 thedoris_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\
- Refer to this path:
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.
- Gather your connection details
To connect to Apache Doris via JDBC, you need the following information:
Parameter | Meaning | Example |
---|---|---|
Server | Database host | 127.0.1.28 |
Port | Database MySQL port | 9030 |
Catalog | Doris Catalog, used when querying external tables and data lakes, set in Advanced | internal |
Database | Database name | tpch |
Authentication | Choose database authentication method: Username / Username and Password | Username and Password |
Username | Username | testuser |
Password | Password | Leave blank |
Init SQL Statement | Initial SQL statement | select * from database.table |
- Launch Tableau. (If you were already running it before placing the connector, please restart.)
- From the left menu, click More under the To a Server section. In the list of available connectors, search for Doris JDBC by VeloDB:
- Click Doris by VeloDB ,the following dialog will pop up:
-
Enter the corresponding connection information as prompted in the dialog.
-
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,
- You can enter preset SQL in Initial SQL to define the data source
-
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
- Drag the customer table and orders table to the workbook. And select the table join field Custkey for them below
- Drag the nation table to the workbook and select the table join field Nationkey with the customer table
- 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. - 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 toRows
. 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.
- 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
- Click the
You should see the following:
- 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: - Click
SUM
and changeMeasure
toAverage
. - From the same dropdown menu, select
Format
and changeNumbers
toCurrency (Standard)
: - 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.