All Products
Search
Document Center

Hologres:Create multiple foreign tables at a time

Last Updated:Dec 25, 2023

This topic describes how to use HoloWeb to create multiple foreign tables at a time in a visualized manner.

Prerequisites

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

Create multiple foreign tables at a time

  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. Go to HoloWeb

  4. In the top navigation bar of the HoloWeb console, choose Metadata Management > MaxCompute Acceleration > Create Multiple Foreign Tables.

    You can also click Instances Connected in the left-side navigation pane of the Metadata Management tab. Click the instance that you want to manage and click the database that you want to manage. Right-click the schema that you want to manage and select Create Multiple Foreign Tables.

  5. On the Create Multiple Foreign Tables tab, configure the parameters.

    Section

    Parameter

    Description

    MaxCompute Data Source

    Project Name

    The name of the MaxCompute project.

    Schema Name

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

    Destination Table Position

    Schema Name

    The name of the schema.

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

    Advanced Settings

    Data Source

    • Entire Project: creates foreign tables for all the tables in the MaxCompute project at a time.

    • Selected Tables: creates foreign tables only for specified tables in the MaxCompute project. You can search for required tables based on table names or keywords.

      Note

      If you select Selected Tables and search for required tables, a maximum of 200 tables are displayed in the search results. The excess tables are not displayed, but foreign tables can be created for the excess tables.

      For example, the MaxCompute project has 203 tables whose names contain test. When you enter test to search for tables, only 200 tables are displayed in the search results. However, foreign tables can be created for all 203 tables.

    Processing Rule for Table Name Conflicts

    • Ignore Conflicts and Continue Creating Tables: If a foreign table that you want to create is named the same as an existing foreign table in the database, the system skips the creation of this table and continues to create other tables.

    • Change Table Names: If a foreign table that you want to create is named the same as an existing foreign table in the database, the system updates data in the existing foreign table.

    • Report Error and Create No Table: If a foreign table that you want to create is named the same as an existing foreign table in the database, an error is reported to prevent repeated creation.

    Processing Rule for Unsupported Data Types

    • Report Error and Stop Import: If specific data types in the source tables are not supported by Hologres, an error is reported and data import fails.

    • Ignore and Skip Table of Unsupported Fields: If specific data types in the source tables are not supported by Hologres, the system imports data from all fields except for fields of the unsupported data types.

    Note

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

  6. Click Run to create multiple foreign tables at a time.