This topic describes how to use DataStudio to import MaxCompute data to Hologres.

Prerequisites

  • DataWorks is activated. A DataWorks workspace is created. For more information, see Create a workspace.
  • A Hologres instance is purchased and bound to a DataWorks workspace.

Background information

DataStudio allows you to import table data with a few clicks. You can import MaxCompute data and query the imported data in a visualized manner. This provides better performance than creating foreign tables for data queries.

You can also use SQL statements to import MaxCompute data. For more information, see Import data from MaxCompute to Hologres by executing SQL statements.

Procedure

  1. Create a One-click MaxCompute data synchronization node.
    1. Log on to the DataWorks console.
    2. In the left-side navigation pane, click Workspaces.
    3. In the top navigation bar, select the region in which the workspace resides. Find the workspace and click Data Analytics.
    4. In the left-side navigation pane of the DataStudio page, click the DataStudio icon.
    5. In the Scheduled Workflow pane, move the pointer over the Create icon and choose Hologres > One-click MaxCompute data synchronization.
      One-click MaxCompute data synchronization
    6. In the Create Node dialog box, set the Node Name and Location parameters and click Commit.
  2. On the node configuration tab, set the parameters as required.
    Node configurations
    Parameter Description
    Target connection The name of your Hologres instance.
    Target Library The name of the database in the Hologres instance.
    External table source
    • Specifies whether the relevant foreign table exists. Valid values: External table already exists

      The foreign table that is used to map MaxCompute data exists in Hologres.

    • New external table

      You need to create a foreign table.

    External table table name The name of the existing foreign table. The name of the foreign table must correspond to the name of the MaxCompute table that you want to synchronize.
    Target schema The name of the schema to which the destination table belongs. The default value is public. If you have created a schema, you can select the created schema.
    Destination Table Name The name of the destination Hologres table to which you want to import data. If a Hologres table with the same name exists, the original table and data in the table are automatically deleted after the data sync node is run.
    Target table description The description of the destination Hologres table to which you want to import data.
    Synchronization field The fields in the MaxCompute table that you want to synchronize. You can select all or some of the fields.
    Partition configuration The partition fields to be synchronized. Hologres supports a maximum of one level of partitioning.
    Index configuration The index to be built for the destination table. For more information, see the documentation about how to set table properties.
    SQL Statements The SQL statements to be executed when the data sync node is run.
  3. On the node configuration tab, click the Save icon to save the configurations.
  4. On the node configuration tab, click the Run icon to import data from the specified MaxCompute table.
  5. Query the synchronized MaxCompute data.
    1. On the left-side navigation submenu, click the PostgreSQL management icon to go to the Workspace Tables page.
    2. Double-click the destination Hologres table to go to the table configuration tab.
  6. Optional. Configure periodic scheduling.
    1. On the node configuration tab, click Properties. In the panel tab, configure properties for the node. For more information, see Configure basic properties.
    2. On the node configuration tab, click the Save icon in the top toolbar to save the node.
    3. Click the Submit icon in the top toolbar to commit the node.
    4. In the Commit Node dialog box, enter your comments in the Change description field and click Determine.