Connect Tableau to MaxCompute

更新时间:
复制 MD 格式

You can connect Tableau to your MaxCompute project for data visualization. With Tableau's intuitive drag-and-drop interface, you can customize views, layouts, shapes, and colors to present your data. This topic describes how to use the MaxCompute JDBC driver to connect Tableau to a MaxCompute project and visualize data.

Background information

Tableau Desktop is software built on groundbreaking technology from Stanford University. It helps you analyze virtually any structured data and generate compelling charts, dashboards, and reports in minutes. For more information about Tableau Desktop, see Tableau Desktop.

To analyze MaxCompute data with Tableau Desktop, you must first connect to your MaxCompute project using the MaxCompute JDBC driver. For more information about the driver, see MaxCompute JDBC.

Prerequisites

Before you begin, make sure that the following prerequisites are met:

  • You have created a MaxCompute project.

    For more information, see Create a MaxCompute project.

  • You have obtained an AccessKey ID and AccessKey Secret with permissions to access the MaxCompute project.

    You can go to the AccessKey Management page to obtain an AccessKey ID and an AccessKey Secret.

  • You have installed Tableau Desktop (2019.4 or later), which has a built-in MaxCompute Connector.

    For information about operating system requirements, see Operating System.

    This topic uses Tableau Desktop 2021.1 as an example.

  • You have downloaded the MaxCompute JDBC driver (v3.0.1 or later). Make sure that you download the JAR package that contains jar-with-dependencies in its filename.

    This topic uses MaxCompute JDBC driver v3.2.9 as an example.

Procedure

Follow these steps to connect Tableau to a MaxCompute project:

  1. Step 1: Place the MaxCompute JDBC driver

    Place the MaxCompute JDBC driver in the drivers directory of Tableau Desktop. Tableau Desktop uses this driver to access your MaxCompute project.

  2. Step 2: Connect Tableau to a MaxCompute project

    Configure the connection parameters to connect Tableau to your MaxCompute project.

  3. Step 3: Use Tableau to query and analyze data

    Access data from your MaxCompute project and perform data visualization in Tableau Desktop.

Step 1: Place the MaxCompute JDBC driver

Place the downloaded MaxCompute JDBC driver JAR package into the appropriate directory based on your operating system:

  • Windows: C:\Program Files\Tableau\Drivers

  • Mac: ~/Library/Tableau/Drivers

  • Linux: /opt/tableau/tableau_driver/jdbc

For more information about how to use the JDBC driver, see Usage notes for the JDBC driver.

Step 2: Connect Tableau to a MaxCompute project

  1. Start Tableau Desktop.

  2. In the To a Server section of the left-side navigation pane, select More... > Alibaba MaxCompute.

  3. In the Alibaba MaxCompute dialog box, on the General tab, configure the parameters.

    Parameter

    Description

    Server

    The connection URL for the MaxCompute project. Use the following format: https://<MaxCompute_endpoint>?project=<MaxCompute_project_name>[&interactiveMode={true|false}]. The parameters are as follows:

    • <MaxCompute_endpoint>: Required. The endpoint of the region where your MaxCompute project is located.

      For a list of endpoints, see Endpoints.

    • <MaxCompute_project_name>: Required. The name of the target MaxCompute project.

      This is the name of your MaxCompute project, not a workspace. You can sign in to the MaxCompute console, switch the region in the upper-left corner, and find the project name on the Projects page.

    • interactiveMode: Optional. Specifies whether to enable the Query Acceleration feature.

      To enable Query Acceleration, append &interactiveMode=true to the URL. For more information, see Query Acceleration.

    Username

    The AccessKey ID that has permissions to access the target MaxCompute project.

    You can go to the AccessKey Management page to obtain an AccessKey ID.

    Password

    The AccessKey Secret that corresponds to the AccessKey ID.

    You can go to the AccessKey Management page to obtain an AccessKey Secret.

    Note

    Tableau Desktop 2019.4 does not support an AccessKey Secret that ends with an equal sign (=). If your AccessKey Secret contains this character, generate a new AccessKey ID and AccessKey Secret.

  4. Click Sign in to open the Tableau Desktop interface.

  5. From the Database drop-down list, select your target MaxCompute project. Tableau Desktop automatically connects to the project.

    After a successful connection, the left pane lists the available tables in the project, such as table_resource1, target, and test. Drag a table to the Drag tables here area on the right to begin your analysis.

Step 3: Query and analyze data

For detailed instructions on these operations, see Tableau Help.

  • View all tables

    After you select the MaxCompute project from the Database list in the left pane, Tableau Desktop automatically loads all tables in the project.

  • View table schema

    In the Table area, drag a table to the upper-right area and click the 图标 icon to view its schema.

    The table schema is displayed in a list with three columns: Field Name, Table, and Remote Field Name. An icon indicates the data type of each field: # for numeric and Abc for text.

  • View table data

    In the Table area, drag a table to the upper-right area and click the 图标 icon to view its data.

    Click the data grid view icon. The fields (such as Age, Job, Marital, and Education) and their data rows are displayed in a table.

  • Visualize data

    At the bottom of the Tableau Desktop interface, click the 新建工作表 icon to open a new worksheet where you can configure parameters and analyze your data.

    For example, select the bank_data_pt data source. Drag the Education field to both the Color and Size Marks cards. Set Credit as a filter and select the Count measure. This action generates a packed bubble chart grouped by education level, showing the data distribution across categories such as high.school, university.degree, professional.course, and basic.9y.