All Products
Search
Document Center

Hologres:Import MaxCompute data to Hologres with a few clicks

Last Updated:Sep 23, 2024

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

Prerequisites

A Hologres data source is added to your DataWorks workspace and is associated with DataStudio. For more information, see Associate a Hologres instance with a workspace.

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 import MaxCompute data by executing SQL statements. For more information, see Import data from MaxCompute to Hologres by executing SQL statements.

Procedure

  1. Create a Data Synchronization from MaxCompute 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 where the desired workspace resides. On the Workspaces page, find the workspace and choose Shortcuts > Data Development in the Actions column.

    4. In the left-side navigation pane of the DataStudio page, click Scheduled Workflow.

    5. In the top navigation bar of the Scheduled Workflow pane, move the pointer over the Create icon and choose Create Node > Hologres > Data Synchronization from MaxCompute.

    6. In the Create Node dialog box, configure the Engine Instance, Path, and Name parameters, and click Confirm. The configuration tab of the node appears.

  2. On the configuration tab of the node, configure parameters. The following table describes the parameters.

    Section

    Parameter

    Description

    Select MaxCompute Source Table

    Destination Name

    The name of the Hologres data source that is associated with DataStudio.

    Destination Database

    The name of the database in the Hologres instance.

    Source Of External Table

    • Existing External Table

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

    • Create 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 Source of External Table parameter to Existing External Table.

    External Table Name

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

    This parameter is available if you set the Source of External Table parameter to Existing External Table.

    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 Source of External Table parameter to Create 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 Source of External Table parameter to Create 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 Source of External Table parameter to Create External Table.

    Destination Table Settings

    Destination Schema

    The name of the schema to which the destination table belongs.

    Target Table

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

    Destination Table Description

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

    Configure GUC Parameters for Data Import

    GUC Parameters

    The Grand Unified Configuration (GUC) parameters that you must configure before you import data from MaxCompute to Hologres. For more information about the GUC parameters that are supported by Hologres, see GUC parameters. Other SQL statements are not supported.

    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 Configurations

    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 CREATE TABLE.

    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 保存 icon to save the configurations.

  4. On the node configuration tab, click the 运行 icon to run the synchronization node to import MaxCompute data.

  5. View the synchronized MaxCompute table data.

    1. In the left-side navigation pane of the DataStudio page, click the PG管理 icon to go to the Workspace Tables pane.

    2. Double-click the destination Hologres table to go to the table configuration tab.

      Note

      If the destination table is not displayed in the Workspace Tables pane, you must collect Hologres metadata in Data Map. For more information, see Data Map (Beta).

  6. Optional. Configure periodic scheduling.

    1. Click Properties in the right-side navigation pane of the configuration tab of the node to configure scheduling properties for the node. For more information, see Configure basic properties.

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

    3. Click the 提交 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.