This topic describes how to use the one-click table schema synchronization feature of DataStudio to create multiple foreign tables at a time in Hologres.
- DataWorks is activated. A DataWorks workspace is created. For more information, see Create a workspace.
- A Hologres instance is purchased and bound to a DataWorks workspace.
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 in Hologres to accelerate queries of MaxCompute data.
DataStudio provides the One-click MaxCompute table structure synchronization feature. You can use this feature to create multiple foreign tables at a time in Hologres in a visualized manner.
- Create a One-click MaxCompute table structure synchronization node.
- Log on to the DataWorks console.
- In the left-side navigation pane, click Workspaces.
- In the top navigation bar, select the region in which the workspace resides. Find the workspace and click Data Analytics.
- In the left-side navigation pane of the DataStudio page, click the icon.
- On the DataStudio page, move the pointer over the icon in the top toolbar and choose Hologres > One-click MaxCompute table structure synchronization.
- In the Create Node dialog box, set the Node Name and Location parameters and click Commit.
- On the node configuration tab, set the parameters as required.
Parameter Description Target connection The name of your Hologres instance. Target Library The name of the database in the Hologres instance. Schema The name of the schema to which the Hologres tables belong. The default value is public. If you have created a schema, you can select the created schema. Type The type of foreign tables. You can create only foreign tables sourced from MaxCompute. Server List The name of the server to be used. After a Hologres instance is created, a server named odps_server is automatically created and can be used. For more information, see postgres_fdw. Source Project The name of the MaxCompute project for which you want to create foreign tables. Select tables The tables for which you want to create foreign tables. You can select Entire Project or Selected Tables based on your requirements. Processing Rule for Table Name Conflicts The rule to process the duplication of table names. Valid values:
- Ignore, continue to create the rest tables
- Update, modify the same name tables
- Alert, do not duplicately create
Unsupported data type The rule to process unsupported data types. Valid values:
- Alert, import failure
- Ignore, skip unsupported columns
- On the node configuration tab, click the icon to save the configurations.
- On the node configuration tab, click the icon to run the node to create multiple foreign tables at a time.
- View the created foreign tables.
- In the left-side navigation pane, click the icon to go to the PostgreSQL management page.
- Double-click the foreign table that you want to view to go to the editing page of the table.