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
Log on to the Hologres console.
In the top navigation bar, select a region from the drop-down list.
In the left-side navigation pane of the Hologres console, click Go to HoloWeb to go to the HoloWeb console.
In the main menu bar of the HoloWeb console, choose > Create Foreign Table.
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 New foreign table.
On the New foreign table tab, configure the parameters.
Section
Parameter
Description
Source MaxCompute Table
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.
Table Name
The name of the MaxCompute table. Prefix-based fuzzy search is supported.
Destination Hologres Table
Database Name
The name of the Hologres database to which the foreign table belongs.
Schema Name
Schema Name
You can select the default schema named public or a custom schema.
Table Name
The name of the Hologres foreign table.
The name of the source MaxCompute table is automatically specified for this parameter. You can also manually rename the table.
Destination Table Description
The description of the Hologres foreign table that you create, which is user-defined.
NoteWhen 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.
Click Submit. After the foreign table is submitted, you can refresh the left-side instance lists. The created foreign table is displayed in the schema that you selected.
Optional: On the configuration tab of the foreign table, click Query table to go to the SQL query window and execute standard PostgreSQL statements to analyze data.
Edit a foreign table
In the left-side navigation pane, click Instances Connected. All the connected instances are displayed.
Click the instance that you want to manage. All the created databases are displayed.
Click the database that you want to manage, click the schema that you want to manage, and then click Foreign Tables. All the created foreign tables are displayed.
Right-click the foreign table that you want to manage and select Edit Table.
Modify the fields and partitions of the foreign table that is mapped from the source MaxCompute table based on your business requirements.
Click Submit. The foreign table is edited.
Rename a foreign table
In the left-side navigation pane, click Instances Connected. Find the foreign table that you want to manage.
For more information about how to query a foreign table, see Step 1 to Step 3 in Edit a foreign table.
Right-click the foreign table that you want to rename and select Rename.
Click OK.
Delete a foreign table
In the left-side navigation pane, click Instances Connected. Find the foreign table that you want to manage.
For more information about how to query a foreign table, see Step 1 to Step 3 in Edit a foreign table.
Right-click the foreign table that you want to delete and select Delete Table.
Click OK.
Preview data
In the left-side navigation pane, click Instances Connected. Find the foreign table that you want to manage.
For more information about how to query a foreign table, see Step 1 to Step 3 in Edit a foreign table.
Double-click the foreign table that you want to preview. On the configuration tab of the foreign table, click Data preview.