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 . In the Acceleration Method section of the page that appears, select Single Table.
You can also click Instances Connected in the left-side navigation pane of the Metadata Management tab. Click the name of the instance that you want to manage and click the name of the database that you want to manage. Right-click the name of the schema that you want to manage and select Create MaxCompute External Table.
In the Acceleration Method section of the page that appears, select Single Table and 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
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. You can specify a description based on your business requirements.
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 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.
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
In the left-side navigation pane, click Instances Connected. All the connected instances are displayed.
Click the name of the instance that you want to manage. All the created databases are displayed.
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.
Right-click the name of the foreign table that you want to manage, select Open Table, and then click Edit Table in the upper-right corner.
Modify the fields and partitions of the foreign table that is sourced from the 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 name of the foreign table and select Rename.
In the message that appears, 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 name of the foreign table and select Delete Table.
In the message that appears, 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 name of the foreign table. On the foreign table page, click Data Preview.