Skip to main content

QuickSight

QuickSight can connect to Apache Doris through the official MySQL data source, and supports both Directly query and Import modes. This document is intended for users who want to analyze Doris data in QuickSight. It covers connection preparation, dataset creation, and the workflow for building a multi-table associated visualization dashboard based on TPC-H data.

Applicable scenarios

Use caseUser goalOutcome
Connect to a Doris data sourceConnect to Apache Doris in QuickSight through the official MySQL data sourceQuickSight can access data in the Doris cluster
Create an analysis datasetCreate a QuickSight Dataset based on a Doris tableThe dataset can be used for subsequent analysis and visualization
Build a multi-table associated dashboardUse the TPC-H customer, nation, and orders tables for associated analysisA dashboard that counts the number of orders by country and order status is generated

Workflow

StageGoalDescription
Step 1Complete connection preparationVerify the Doris version, network connectivity, and MySQL compatibility version
Step 2Create a QuickSight data sourceUse the official QuickSight MySQL connector to connect to Apache Doris
Step 3Create a DatasetSelect a Doris table and create a dataset using Directly query mode
Step 4Build a visualization dashboardAdd multiple Datasets, configure table associations, and publish the analysis dashboard

Prerequisites

Before starting the configuration, confirm that the following conditions are met:

RequirementSpecification
Doris versionApache Doris version 3.1.2 or later
Network connectivityConfigure VPC and security groups according to the Doris deployment environment to ensure that the AWS server can access the Doris cluster
MySQL compatibility versionDeclare the MySQL compatibility version on the MySQL client connecting to Doris

On the MySQL client connecting to Doris, run the following SQL to declare the MySQL compatibility version:

SET GLOBAL version = '8.3.99';

Run the following SQL to verify the configuration:

mysql> show variables like "version";
+---------------+--------+---------------+---------+
| Variable_name | Value | Default_Value | Changed |
+---------------+--------+---------------+---------+
| version | 8.3.99 | 5.7.99 | 1 |
+---------------+--------+---------------+---------+
1 row in set (0.01 sec)

Connect QuickSight to Apache Doris

This section describes how to create a Doris data source in QuickSight and create a Dataset based on a Doris table.

Step 1: Create a new QuickSight dataset

Go to the QuickSight console, open the datasets page, and click New dataset.

Open the QuickSight datasets page

Create a new QuickSight dataset

Step 2: Select the MySQL connector

Search for and select the official MySQL connector built into QuickSight.

Select the QuickSight MySQL connector

Step 3: Fill in the Doris connection information

Fill in the Doris connection information as required on the page. The MySQL interface port defaults to 9030. The actual port is determined by the query_port configuration of the Doris FE.

Fill in the Doris connection information

Step 4: Select the Doris table and query mode

Select the Doris table you want to analyze from the list.

Select the Doris table

Selecting Directly query mode is recommended.

Select Directly query mode

After clicking Edit/Preview data, you can view the table schema, adjust custom SQL, and modify the Dataset here.

Preview and edit the QuickSight Dataset

Step 5: Publish the Dataset and create a visualization

After the Dataset configuration is complete, you can publish the dataset and create a new visualization.

Publish the QuickSight Dataset

Build a visualization in QuickSight

This section uses TPC-H data as the data source to demonstrate how to build a visualization dashboard based on multi-table associations in QuickSight. For instructions on building the Doris TPC-H data source, see the TPC-H benchmark documentation.

The example goal is to count the number of orders for each country across different order statuses. Because Doris delivers good query performance for multi-table association scenarios, this document uses the customer, nation, and orders tables for associated analysis.

Step 1: Create a Dataset based on a Doris table

  1. Use the Data source created earlier to add the following tables as Datasets:

    • customer
    • nation
    • orders
  2. Click Create dataset.

    Create a QuickSight dataset

  3. Select the data source created earlier.

    Select the previously created data source

  4. Select the required table.

    Select the table to analyze

  5. Select Directly query mode.

    Select Directly query mode for the Dataset

  6. Click Visualize to create the data source, and follow the same steps to create data sources for the other tables.

Step 2: Add multiple Datasets to the analysis

  1. Open the dashboard authoring workspace, click the current Dataset dropdown, and select Add new dataset.

    Add a new dataset to the analysis

  2. Select all the datasets you want to use, and click Select to add them to the current dashboard.

    Select multiple Datasets

Step 3: Configure Dataset associations

  1. After adding the datasets, click the action entry for nation to open the dataset edit interface.

    Open the nation dataset edit interface

  2. Click Add data to add a data source.

    Add a data source to the Dataset

  3. After adding all three tables, configure the association keys. The associations are as follows:

    Left tableLeft fieldRight tableRight field
    customerc_nationkeynationn_nationkey
    customerc_custkeyorderso_custkey

    Configure the associations among the three tables

  4. After the associations are configured, click Save & publish in the upper-right corner to publish.

    Publish the associated Dataset

Step 4: Configure charts and publish the dashboard

  1. Return to the Analyses interface where the three data sources have been added, and click n_name to generate a chart that counts the total number of orders by country name.

    Count the total number of orders by country name

  2. Select o_orderkey in VALUE and o_orderstatus in GROUP/COLOR to obtain a dashboard that counts the number of orders by country and order status.

    Count the number of orders by country and order status

  3. Click Publish in the upper-right corner to complete the dashboard publication.

Result

You have now successfully connected QuickSight to Apache Doris and built data analysis and visualization dashboards.