This topic describes how to use DataStudio to import MaxCompute data to Hologres with a few clicks.
Prerequisites
- DataWorks is activated. A DataWorks workspace is created. For more information, see Create a workspace.
- A Hologres instance is purchased and associated with a DataWorks workspace. For more information, see Associate a Hologres instance with a workspace.
Background information
DataStudio allows you to import MaxCompute data with a few clicks. You can import MaxCompute data and query the imported data in a visualized manner. This method provides better performance than the method of creating foreign tables for data queries.
You can also use SQL statements to import MaxCompute data. For more information, see Import data from MaxCompute to Hologres by executing SQL statements.
Procedure
Create a node that is used to import MaxCompute data to Hologres with a few clicks.
- 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 that you want to manage resides. Find the workspace and click DataStudio in the Actions column.
- In the left-side navigation submenu of the DataStudio page, click the icon.
In the top toolbar of the Scheduled Workflow pane, move the pointer over Create. Choose Create Node > Hologres > One-click MaxCompute data synchronization.
In the Create Node dialog box, configure the Engine Instance, Path, and Name parameters and click Confirm.
On the node configuration tab, configure the parameters.
Section
Parameter
Description
MaxCompute Source table connection
Target connection
The name of your Hologres instance.
Target Library
The name of the database in the Hologres instance.
External table source
External table already exists
The foreign table that is used to map MaxCompute data exists in Hologres.
New external table
No foreign table exists. You need to create a foreign table.
External Schema
The name of the schema in which the foreign table that maps the MaxCompute table resides.
This parameter is available if you set the External table source parameter to External table already exists.
External table table name
The name of the foreign table that maps the MaxCompute table.
This parameter is available if you set the External table source parameter to External table already exists.
External server
After a Hologres instance is created, a server named odps_server is automatically created and can be used. For more information, see postgres_fdw.
This parameter is available if you set the External table source parameter to New external table.
MaxCompute Project
The name of the MaxCompute project from which you want to import data.
This parameter is available if you set the External table source parameter to New external table.
MaxCompute table name
The name of the MaxCompute table from which you want to import data.
This parameter is available if you set the External table source parameter to New external table.
Target table settings
Target schema
The name of the schema to which the destination table belongs. The default value is public. If you have created a schema, you can select the created schema.
Destination Table Name
The name of the destination Hologres table to which you want to import data. If a Hologres table with the same name exists, the original table and data in the table are automatically deleted after the data synchronization node is run.
Target table description
The description of the destination Hologres table to which you want to import data.
Synchronization settings
Synchronization field
The fields in the MaxCompute table that you want to import. You can select all or some of the fields.
Partition configuration
The partition fields that you want to import. Hologres only supports one level of partitions.
If you import data from a MaxCompute table that involves multiple levels of partitions, you must specify the level-1 partition field of the MaxCompute table for the destination table. Other partition fields in the MaxCompute table are mapped to common fields in the destination table.
Index configuration
The indexes that you want to create for the destination table. For more information about how to create an index, see Overview.
SQL Script
SQL Script
The SQL statements that need to be executed when the data synchronization node is run.
On the node configuration tab, click the icon to save the configurations.
On the node configuration tab, click the icon to import data from the specified MaxCompute table.
View the synchronized MaxCompute table data.
On the left-side navigation submenu, click the icon to go to the Workspace Tables page.
Double-click the destination Hologres table to go to the table configuration tab.
Optional. Configure periodic scheduling.
On the node configuration tab, click Properties. Then, configure properties for the node. For more information, see Configure basic properties.
On the node configuration tab, click the icon in the top toolbar to save the node.
Click the icon in the top toolbar to commit the node.
In the Commit Node dialog box, enter a description in the Change description field and click OK.