This topic describes how to use HoloStudio to create multiple foreign tables at a time.
- An Alibaba Cloud account is created.
- Real-name verification is completed.
- A Hologres instance is purchased and bound to a DataWorks workspace. For more information, see Quick start to HoloStudio.
Hologres is integrated with MaxCompute at the underlying layer. You can create foreign tables to accelerate queries of MaxCompute data. For more information, see Create a foreign table to accelerate queries of MaxCompute data.
The Data Analytics module of HoloStudio provides the One-click MaxCompute table structure synchronization submodule. In this submodule, you can create foreign tables in a visualized manner.
You can also use the
IMPORT FOREIGN SCHEMA statement to create multiple foreign tables at a time. You can execute this statement
in a data analytics node in the Interactive Analytics Development submodule of Data
Analytics and schedule the node to implement the following feature: A foreign table
is automatically created in Hologres after a MaxCompute table is created. For more
information, see Hologres Data Analytics.
- Create a schema sync node.
- Log on to the Hologres console.
- In the top navigation bar of the console, move the pointer over the icon and select the region where your Hologres instance resides.
- In the left-side navigation pane, click Hologres Instances page, click Go to DataWorks - HoloStudio.. On the
- In the left-side navigation pane of HoloStudio, click the .
- On the Data Analytics page, move the pointer over the icon.
- Click One-click MaxCompute table structure synchronization.
- In the Create Node dialog box, set Node Name, Location, and Database.
- Click Commit.
- On the editing page of the created node, set the parameters as required.
Parameter Description Target Library The name of the Hologres database where the foreign tables are created. Target schema The name of the schema in the specified Hologres database.
If you have not created a schema, select the default public schema. If you have created a schema, you can select the created schema.
Remote Service type The type of the external service. Default value: odps.
You can create foreign tables that are sourced only from MaxCompute.
Remote server You can directly call the odps_server server created at the underlying layer of Hologres. For more information, see Postgres FDW. Remote library The name of the MaxCompute project where the tables for which you want to create foreign tables reside. Table name rules The regular expression that is used to specify the tables for which you want to create foreign tables. By default, foreign tables are created for all tables in the specified MaxCompute project. For more information about the rules that are used to filter tables, see IMPORT FOREIGN SCHEMA. Regular preview The execution result of the regular expression.When you create a foreign table, the following rules apply:
- The foreign table cannot be created if it has the same name as an existing foreign table in Hologres.
- An error occurs if the foreign table contains data types that are not supported by Hologres. In this case, you must exclude the MaxCompute table from the regular expression and create another foreign table.
- On the editing page of the created node, click the icon to save the configurations.
- On the editing page of the created node, click the icon to create multiple foreign tables.
- On the PG management page, view the created foreign tables and query data by using these tables. For more information, see Create and manage foreign tables.