Create a MaxCompute foreign table in HoloWeb

更新时间:
复制 MD 格式

This topic describes how to use HoloWeb to create, edit, or delete foreign tables, and how to preview foreign table data and DDL statements.

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 management console.

  2. In the top navigation bar, select a region.

  3. Click Go to HoloWeb to open the HoloWeb developer page.

  4. In the top navigation bar of the HoloWeb development page, choose Metadata Management > Import from MaxCompute, and then click Create Foreign Table.

    You can also click the target database in the Logged-in Instances list on the Metadata Management page, right-click the target schema under the database, and select Create MaxCompute External Table.

  5. On the Create Foreign Table page, configure the parameters based on the selected acceleration method.

    Entire project

    Category

    Parameter

    Description

    Acceleration Method

    Select an acceleration method.

    Hologres supports the following acceleration methods:

    • 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 MaxCompute schema.

    For a MaxCompute project for which schemas are enabled, you can specify any schema that you are authorized to access. This parameter is not required for projects for which schemas are not enabled. For more information about schemas, see Schema operations.

    Destination Table Position

    Holo schema

    The name of the schema.

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

    Advanced Settings

    Processing Rule for Table Name Conflicts

    Select how to handle table name conflicts:

    • Ignore and continue creating other tables

    • Update and modify the table with the same name

    • Report an error and stop creating tables

    Processing Rule for Unsupported Data Types

    Select how to handle unsupported data types:

    • Report an error and fail the import

    • Ignore and Skip Table of Unsupported Fields

    Selected tables

    Category

    Parameter

    Description

    Acceleration Method

    Select an acceleration method.

    Hologres supports the following acceleration methods:

    • 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 MaxCompute schema.

    For a MaxCompute project for which schemas are enabled, you can specify any schema that you are authorized to access. This parameter is not required for projects for which schemas are not enabled. For more information about schemas, see Schema operations.

    Destination Table Position

    Holo schema

    The name of the schema.

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

    Advanced Settings

    Processing Rule for Table Name Conflicts

    Select how to handle table name conflicts:

    • Ignore and continue creating other tables

    • Update and modify the table with the same name

    • Report an error and stop creating tables

    Processing Rule for Unsupported Data Types

    Select how to handle unsupported data types:

    • Report an error and fail the import

    • Ignore and Skip Table of Unsupported Fields

    Search

    You can perform a fuzzy search by table name. A maximum of 200 tables can be displayed.

    Single table

    Category

    Parameter

    Description

    Acceleration Method

    Select an acceleration method.

    Hologres supports the following acceleration methods:

    • 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 MaxCompute schema.

    For a MaxCompute project for which schemas are enabled, you can specify any schema that you are authorized to access. This parameter is not required for projects for which schemas are not enabled. For more information about schemas, see Schema operations.

    Table Name

    The data table in the specified MaxCompute schema. Fuzzy search by table name prefix is supported.

    Destination Hologres Table

    Schema

    The name of the schema.

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

    Table Name

    The name of the Hologres table that you want to use for query acceleration.

    Destination Table Description

    The description of the Hologres table that you want to use for query acceleration.

    Note

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

  6. Click Submit. Then, refresh the schema in the navigation pane to view the new foreign table.

  7. Optional: On the page of the newly created foreign table, click Query Table to open the SQL query window. You can then use standard PostgreSQL to write queries.

Edit a foreign table

  1. In the navigation pane, click Instances Connected.

  2. Under the target instance, click Database.

  3. Under the target database and in the target Schema, click Foreign Tables.

  4. Right-click the target foreign table and select Open Table.

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

  6. You can change the mapped Fields or Partitions of the source table. The edit page displays basic settings such as Instance Name, Database, Table Name, Description, and Schema. In the External Service section, configure the service Type (for example, MaxCompute), Server List (for example, odps_server), and the source Table. On the Basic Information tab, use the Fields and Partitions subtabs to view and edit the field list. When you are finished, click Submit Table to save your changes.

  7. Click Submit to save your changes.

Rename a foreign table

  1. In the Instances Connected list in the navigation pane, find the target foreign table.

  2. Under the target instance, click Database to display a list of all created databases.

  3. Under the target database and in the target Schema, click Foreign Tables to display a list of all created foreign tables.

  4. Right-click the target foreign table and select Rename.

  5. Click OK.

Delete a foreign table

  1. In the Instances Connected list in the navigation pane, find the target foreign table.

  2. Under the target instance, click Database to display a list of all created databases.

  3. Under the target database and in the target Schema, click Foreign Tables to display a list of all created foreign tables.

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

  5. In the message that appears, click OK.

Preview data

  1. In the Instances Connected list in the navigation pane, find the target foreign table.

  2. Under the target instance, click Database to display a list of all created databases.

  3. Under the target database and in the target Schema, click Foreign Tables to display a list of all created foreign tables.

  4. Double-click the target foreign table and click the Data Preview tab on the page that opens.

Related documents

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