Connect Yonghong BI to MaxCompute

Updated at:
Copy as MD

You can connect Yonghong BI to MaxCompute to analyze and visualize data from your MaxCompute projects. This topic guides you through the connection process and data analysis.

Background information

Yonghong Desktop is a desktop business intelligence (BI) tool for data analysis. You can install it on your local machine and use it immediately without complex deployment. It provides one-stop, agile, and efficient capabilities for data governance, visual analysis, and AI-powered deep analysis, simplifying data analysis and visualization for all users. For more information about Yonghong BI, see Yonghong.

Prerequisites

Before you begin, make sure you have the following:

  • An existing MaxCompute project.

    For more information about how to create a MaxCompute project, see Create a MaxCompute project.

  • An AccessKey ID and AccessKey Secret with access to the MaxCompute project.

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

  • An installation of Yonghong Desktop (v9.2.2), which includes a built-in MaxCompute Connector.

    For more information about how to install and start Yonghong Desktop, see Install Yonghong Desktop.

    The example in this topic uses Yonghong Desktop v9.2.2, which includes a built-in MaxCompute JDBC driver.

  • If the built-in MaxCompute JDBC driver in Yonghong Desktop fails to connect to your MaxCompute project, download the MaxCompute JDBC driver (v3.2.8 or later) that includes the jar-with-dependencies package.

    The example in this topic uses MaxCompute JDBC driver v3.2.9. For more information about how to add a driver, see Add a custom driver.

Step 1: Connect Yonghong BI to MaxCompute

  1. Start Yonghong Desktop.

  2. In the left-side navigation pane, click Create Connection.

  3. On the Create Connection page, click image.png and select MaxCompute.

  4. On the Database page, configure the following parameters.

    Parameter

    Description

    Connect to data source

    The type of the target data source. Set this parameter to MaxCompute.

    driver

    The driver used to connect to the MaxCompute project. The following driver types are supported:

    • Default driver: The value is com.aliyun.odps.jdbc.OdpsDriver. In most cases, you do not need to change this value.

    • Custom driver: If the default driver fails to connect to the MaxCompute project, you must select a custom driver. For information about how to add a custom driver, see Add a custom driver.

    URL

    The connection URL for the MaxCompute project. Use the format jdbc:odps:<MaxCompute_endpoint>?project=<MaxCompute_project_name>[&interactiveMode={true|false}], omitting the angle brackets (<>).

    • <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.

    Server login

    The default value is Username and password. You do not need to change the value.

    username

    The AccessKey ID with access to the 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.

  5. At the bottom of the Database page, click Test Connection. After the test succeeds, save the data connection.

    In the dialog box that appears, enter MaxCompute as the file name and click OK to save the file. A MaxCompute data source entry appears under the Demo Data_zhCN node in the right-side navigation pane.

Step 2: Query and analyze data

After creating the data connection, you can query and analyze data in the MaxCompute project. You can perform the following operations. For detailed instructions, see Yonghong Help.

  • View all tables

    After you save the data connection, Yonghong Desktop automatically loads table information from the MaxCompute project.

  • View a table schema

    In the left-side navigation pane of the Yonghong Desktop UI, click Create Dataset, and select MaxCompute as the data source. Then, you can run a custom SQL script to view the table schema on the MetaData tab and save the dataset.

    In the table list, select the bank_data_pt table, enter an SQL statement such as select * from bank_data_pt where age=35, and then click Refresh Data to load data. On the metadata tab, you can view fields such as job (job type), marital (marital status), education (education level), housing (whether the customer has a mortgage), loan (whether the customer has a loan), contact (contact method), duration, and poutcome (outcome of the previous marketing campaign). After you confirm that the schema is correct, click the save icon to save the dataset.

  • View table data

    In the left-side navigation pane of the Yonghong Desktop UI, click Create Dataset, and select MaxCompute as the data source. Then, you can run a custom SQL script to view the table data on the Data Details tab and save the dataset.

    Select the Custom SQL option, enter a query statement such as select * from bank_data_pt where age=35 in the SQL input area, and then click Refresh Data. You can view the query result in the Data Details section on the right. Click the save icon in the top toolbar to save the dataset.

  • Visualize and analyze data

    In the left-side navigation pane of the Yonghong Desktop UI, click Create Dashboard, create a report, select a chart type, and then configure parameters to analyze data based on your business requirements.

    The following report theme templates are available: Default Theme, Classic Blue, Macaron, and Moonlight Blue. On the editing page, drag fields from the data field configuration section on the right to the columns and rows sections. For example, drag Total number of employees_Sum to the columns section and Education Level to the rows section to generate the chart.

Add a custom driver

Yonghong Desktop includes a built-in MaxCompute JDBC driver. If this driver fails to connect to your MaxCompute project, follow these steps to add a custom driver.

  1. Start Yonghong Desktop.

  2. In the upper-left corner, click the 驱动管理 icon, enter a name for the MaxCompute driver, upload the downloaded MaxCompute JDBC driver JAR file such as odps-jdbc-3.2.9-jar-with-dependencies.jar, and then click OK to add the driver.