All Products
Search
Document Center

Hologres:Import MaxCompute data to Hologres with a few clicks

Last Updated:May 29, 2023

This topic describes how to use DataStudio to import MaxCompute data to Hologres with a few clicks.

Prerequisites

Background information

DataStudio allows you to import MaxCompute data with a few clicks. You can import MaxCompute data and query the imported data in a visualized manner. This method provides better performance than the method of 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 node that is used to import MaxCompute data to Hologres with a few clicks.

    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 that you want to manage resides. Find the workspace and click DataStudio in the Actions column.
    4. In the left-side navigation submenu of the DataStudio page, click the DataStudio icon.
    5. In the top toolbar of the Scheduled Workflow pane, move the pointer over Create. Choose Create Node > Hologres > One-click MaxCompute data synchronization.

    6. In the Create Node dialog box, configure the Engine Instance, Path, and Name parameters and click Confirm.

  2. On the node configuration tab, configure the parameters.

    Section

    Parameter

    Description

    MaxCompute Source table connection

    Target connection

    The name of your Hologres instance.

    Target Library

    The name of the database in the Hologres instance.

    External table source

    • External table already exists

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

    • New external table

      No foreign table exists. You need to create a foreign table.

    External Schema

    The name of the schema in which the foreign table that maps the MaxCompute table resides.

    This parameter is available if you set the External table source parameter to External table already exists.

    External table table name

    The name of the foreign table that maps the MaxCompute table.

    This parameter is available if you set the External table source parameter to External table already exists.

    External server

    After a Hologres instance is created, a server named odps_server is automatically created and can be used. For more information, see postgres_fdw.

    This parameter is available if you set the External table source parameter to New external table.

    MaxCompute Project

    The name of the MaxCompute project from which you want to import data.

    This parameter is available if you set the External table source parameter to New external table.

    MaxCompute table name

    The name of the MaxCompute table from which you want to import data.

    This parameter is available if you set the External table source parameter to New external table.

    Target table settings

    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 synchronization node is run.

    Target table description

    The description of the destination Hologres table to which you want to import data.

    Synchronization settings

    Synchronization field

    The fields in the MaxCompute table that you want to import. You can select all or some of the fields.

    Partition configuration

    The partition fields that you want to import. Hologres only supports one level of partitions.

    If you import data from a MaxCompute table that involves multiple levels of partitions, you must specify the level-1 partition field of the MaxCompute table for the destination table. Other partition fields in the MaxCompute table are mapped to common fields in the destination table.

    Index configuration

    The indexes that you want to create for the destination table. For more information about how to create an index, see Overview.

    SQL Script

    SQL Script

    The SQL statements that need to be executed when the data synchronization node is run.

  3. On the node configuration tab, click the Save icon icon to save the configurations.

  4. On the node configuration tab, click the Run icon to import data from the specified MaxCompute table.

  5. View the synchronized MaxCompute table 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. Then, configure properties for the node. For more information, see Configure basic properties.

    2. On the node configuration tab, click the Save icon icon in the top toolbar to save the node.

    3. Click the Submit icon icon in the top toolbar to commit the node.

    4. In the Commit Node dialog box, enter a description in the Change description field and click OK.