All Products
Search
Document Center

Hologres:Synchronize the table schema with a few clicks

Last Updated:Dec 16, 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

  • DataWorks is activated, and a DataWorks workspace is created. For more information about how to create a DataWorks workspace, see Create a workspace.

  • A Hologres instance is purchased and associated with the DataWorks workspace. For more information about how to associate a Hologres instance with a DataWorks workspace, see Associate a Hologres instance with a workspace.

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 Use foreign tables in Hologres to accelerate queries on 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 Schema Synchronization from MaxCompute node.

    1. Go to the DataStudio page.

      Log on to the DataWorks console. In the top navigation bar, select the desired region. In the left-side navigation pane, choose Data Development and Governance > Data Development. On the page that appears, select the desired workspace from the drop-down list and click Go to Data Development.

    2. In the left-side navigation pane of the DataStudio page, click the image icon to go to the Scheduled Workflow pane.

    3. In the top toolbar of the Scheduled Workflow pane, move the pointer over Create, and choose Create Node > Hologres > Schema Synchronization from MaxCompute.

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

    Destination Name

    The name of your Hologres instance.

    Destination Database

    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.

    Servers

    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 For Query Acceleration

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

    Action For Table Name Conflicts

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

    • Ignore Conflicts and Continue Creating Tables

    • Update and Change Names of Tables with Same Names

    • Report Error and Create No Table

    Data Type Not Supported

    The rule to process unsupported data types. Valid values:

    • Report Error and Import Failed

    • Ignore and Skip Unsupported Fields

  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. 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 foreign table that you want to view to go to the editing tab of the table.