All Products
Search
Document Center

Hologres:Create foreign tables mapped to MaxCompute in the HoloWeb console

Last Updated:Jan 10, 2025

This topic describes how to use HoloWeb to create, edit, and delete a foreign table that is sourced from MaxCompute. This topic also describes how to preview the source data and the DDL statement of the foreign table.

Prerequisites

You have logged on to a Hologres instance. For more information, see Log on to an instance.

Create a foreign table

  1. Log on to the Hologres console.

  2. In the top navigation bar, select a region from the drop-down list.

  3. In the left-side navigation pane of the Hologres console, click Go to HoloWeb to go to the HoloWeb console.

  4. In the top navigation bar of the HoloWeb console, click Metadata Management and choose MaxCompute Query Acceleration > Create Foreign Table.

    You can also click Instances Connected in the left-side navigation pane of the Metadata Management tab. Expand your instance to find the database and schema that you want to manage, right-click the name of the schema, and then select Create MaxCompute External Table.

  5. On the Create MaxCompute External Table tab, configure the parameters, which vary based on the specified acceleration method.

    Entire Project

    Category

    Parameter

    Description

    Acceleration Method

    Select an acceleration method.

    Valid values:

    • Entire Project

    • Selected Tables

    • Single Table

    Select Entire Project.

    MaxCompute Data Source

    Project Name

    The name of the MaxCompute project.

    Schema Name

    The name of the schema in which the MaxCompute table resides.

    If your MaxCompute project uses the two-layer model, this parameter is not displayed by default. If your MaxCompute project uses the three-layer model, you can select an authorized schema from the drop-down list. For information about the schema feature, see Schema-related operations.

    Destination Table Position

    Holo Schema

    The name of the schema.

    You can select the default schema named public or a custom schema.

    Advanced Settings

    Processing Rule for Table Name Conflicts

    Valid values:

    • Ignore Conflicts and Continue Creating Tables

    • Change Table Names

    • Report Error and Create No Table

    Processing Rule for Unsupported Data Types

    Valid values:

    • Report Error and Stop Import

    • Ignore and Skip Table of Unsupported Fields

    Selected Tables

    Category

    Parameter

    Description

    Acceleration Method

    Select an acceleration method.

    Valid values:

    • Entire Project

    • Selected Tables

    • Single Table

    Select Selected Tables.

    MaxCompute Data Source

    Project Name

    The name of the MaxCompute project.

    Schema Name

    The name of the schema in which the MaxCompute table resides.

    If your MaxCompute project uses the two-layer model, this parameter is not displayed by default. If your MaxCompute project uses the three-layer model, you can select an authorized schema from the drop-down list. For information about the schema feature, see Schema-related operations.

    Destination Table Position

    Holo Schema

    The name of the schema.

    You can select the default schema named public or a custom schema.

    Advanced Settings

    Processing Rule for Table Name Conflicts

    Valid values:

    • Ignore Conflicts and Continue Creating Tables

    • Change Table Names

    • Report Error and Create No Table

    Processing Rule for Unsupported Data Types

    Valid values:

    • Report Error and Stop Import

    • Ignore and Skip Table of Unsupported Fields

    Search

    A maximum of 200 tables can be displayed when you search for source tables. Excess tables are not displayed.

    Single Table

    Category

    Parameter

    Description

    Acceleration Method

    Select an acceleration method.

    Valid values:

    • Entire Project

    • Selected Tables

    • Single Table

    Select Single Table.

    MaxCompute Data Source

    Project Name

    The name of the MaxCompute project.

    Schema Name

    The name of the schema in which the MaxCompute table resides.

    If your MaxCompute project uses the two-layer model, this parameter is not displayed by default. If your MaxCompute project uses the three-layer model, you can select an authorized schema from the drop-down list. For information about the schema feature, see Schema-related operations.

    Table Name

    The name of the table in the schema of MaxCompute. You can enter a table name prefix to perform a fuzzy match.

    Destination Hologres Table

    Schema

    The name of the schema.

    You can select the default schema named public or a custom schema.

    Table Name

    The name of the Hologres table used for query acceleration.

    Destination Table Description

    The description of the Hologres table used for query acceleration.

    Note

    When you create a foreign table to synchronize data from a MaxCompute table, comments of both the MaxCompute table and columns are synchronized to Hologres.

  6. Click Submit. After you submit the foreign table, you can refresh the left-side instance list. The created foreign table is displayed in the schema that you selected.

  7. Optional. On the page of the foreign table that you create, click Query Table in the upper-right corner to go to the SQL query window and execute standard PostgreSQL statements to analyze data.

Edit a foreign table

  1. In the left-side navigation pane, click Instances Connected. All the connected instances are displayed.

  2. Click the name of the instance that you want to manage. All the created databases are displayed.

  3. Click the name of the database that you want to manage, click the name of the schema that you want to manage, and then click Foreign Tables. All the created foreign tables are displayed.

  4. Right-click the name of the foreign table that you want to manage and select Open Table.

  5. In the upper-right corner of the table tab, click Edit Table.

  6. Modify the fields and partitions of the foreign table based on your business requirements.编辑外部表

  7. Click Submit. The foreign table is edited.

Rename a foreign table

  1. In the left-side navigation pane, click Instances Connected. Find the foreign table that you want to manage.

  2. Click the name of the instance that you want to manage. All the created databases are displayed.

  3. Click the name of the database that you want to manage, click the name of the schema that you want to manage, and then click Foreign Tables. All the created foreign tables are displayed.

  4. Right-click the name of the foreign table and select Rename.

  5. In the dialog box that appears, enter a new name and click OK.

Delete a foreign table

  1. In the left-side navigation pane, click Instances Connected. Find the foreign table that you want to manage.

  2. Click the name of the instance that you want to manage. All the created databases are displayed.

  3. Click the name of the database that you want to manage, click the name of the schema that you want to manage, and then click Foreign Tables. All the created foreign tables are displayed.

  4. Right-click the name of the foreign table and select Delete Table.

  5. In the message that appears, click OK.

Preview data

  1. In the left-side navigation pane, click Instances Connected. Find the foreign table that you want to manage.

  2. Click the name of the instance that you want to manage. All the created databases are displayed.

  3. Click the name of the database that you want to manage, click the name of the schema that you want to manage, and then click Foreign Tables. All the created foreign tables are displayed.

  4. Double-click the name of the foreign table. On the tab that appears, click the Data Preview tab.

References

You can also use SQL statements to create, modify, and drop foreign tables. For more information, see the following topics: