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
Log on to the Hologres management console.
In the top navigation bar, select a region.
Click Go to HoloWeb to open the HoloWeb developer page.
-
In the top navigation bar of the HoloWeb development page, choose , 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.
-
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.
NoteWhen 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.
-
-
Click Submit. Then, refresh the schema in the navigation pane to view the new foreign table.
-
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
-
In the navigation pane, click Instances Connected.
-
Under the target instance, click Database.
-
Under the target database and in the target Schema, click Foreign Tables.
-
Right-click the target foreign table and select Open Table.
-
In the upper-right corner of the table tab, click Edit Table.
-
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.
-
Click Submit to save your changes.
Rename a foreign table
-
In the Instances Connected list in the navigation pane, find the target foreign table.
-
Under the target instance, click Database to display a list of all created databases.
-
Under the target database and in the target Schema, click Foreign Tables to display a list of all created foreign tables.
-
Right-click the target foreign table and select Rename.
-
Click OK.
Delete a foreign table
-
In the Instances Connected list in the navigation pane, find the target foreign table.
-
Under the target instance, click Database to display a list of all created databases.
-
Under the target database and in the target Schema, click Foreign Tables to display a list of all created foreign tables.
-
Right-click the target foreign table and select Delete Table.
-
In the message that appears, click OK.
Preview data
-
In the Instances Connected list in the navigation pane, find the target foreign table.
-
Under the target instance, click Database to display a list of all created databases.
-
Under the target database and in the target Schema, click Foreign Tables to display a list of all created foreign tables.
-
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: