All Products
Search
Document Center

Hologres:Synchronize the table schema with a few clicks

Last Updated:Feb 27, 2024

This topic describes how to use the one-click table schema synchronization feature of DataStudio to create multiple foreign tables at a time in Hologres.

Prerequisites

Background information

Hologres is seamlessly integrated with MaxCompute at the underlying layer. You can create foreign tables to accelerate queries of MaxCompute data. For more information, see Create a foreign table in Hologres to accelerate queries of MaxCompute data.

In DataStudio, you can create a node to synchronize schemas of MaxCompute tables with a few clicks. After you create such a node, you can use the node to create multiple foreign tables at a time in Hologres in a visualized manner.

Procedure

  1. Create a node that is used to synchronize schemas of MaxCompute tables 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 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 submenu of the DataStudio page, click the 数据开发 icon.

    5. In the top toolbar of the Scheduled Workflow pane, move the pointer over Create. Choose Create Node > Hologres > One-click MaxCompute table structure 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.

    参数配置

    Parameter

    Description

    Target connection

    The name of your Hologres instance.

    Target Library

    The name of the database in which you want to create foreign tables in the Hologres instance.

    Schema

    The name of the schema in which you want to create foreign tables. The default value is public. If you have created a schema, you can select the created schema.

    Type

    The source type. You can create only foreign tables sourced from MaxCompute.

    Server List

    The name of the 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.

    Source Project

    The name of the MaxCompute project for which you want to create foreign tables.

    Select tables

    The tables for which you want to create foreign tables. You can select Entire Project or Selected Tables based on your requirements.

    Processing Rule for Table Name Conflicts

    The rule to process conflicts of table names. Valid values:

    • Ignore, continue to create the rest tables

    • Update, modify the same name tables

    • Alert, do not duplicately create

    Unsupported data type

    The rule to process unsupported data types. Valid values:

    • Alert, import failure

    • Ignore, skip unsupported columns

  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 node to create multiple foreign tables at a time.

  5. View the created foreign tables.

    1. On the left-side navigation submenu, click the PG管理 icon to go to the Workspace Tables page.

    2. Double-click the foreign table that you want to view to go to the editing tab of the table.