You can create a Hologres external table by executing a DDL statement. You can also create a Hologres external table in the DataWorks console. This topic describes how to create a Hologres external table in the DataWorks console.
Prerequisites
- A Hologres compute engine is associated with your workspace. For more information, see Associate a Hologres compute engine with a workspace.
- You are assigned a role that has the development permissions, such as the Workspace Manager or Development role. For more information about how to grant users permissions, see Manage permissions on workspace-level services.
Background information
Hologres tables are classified into Hologres internal tables and Hologres external tables.- Hologres internal tables: This type of Hologres table can store source MaxCompute data. You can synchronize data from source MaxCompute tables to Hologres internal tables for quick queries and analysis. The performance of querying MaxCompute data by using Hologres internal tables is better than that by using Hologres external tables.
- Hologres external tables: This type of Hologres table cannot store source MaxCompute data. A Hologres external table can be used to map data of a source MaxCompute table for accelerated queries and analysis. Hologres external tables prevent redundant data storage and allow you to obtain query results in an efficient manner without the need to import or export data.
Limits
You can create a Hologres external table only for MaxCompute.
- You can create a Hologres external table in the DataWorks console only in the China (Shanghai) and China (Beijing) regions.
Procedure
- Go to the DataStudio page.
- Log on to the DataWorks console.
- In the left-side navigation pane, click Workspaces.
- In the top navigation bar, select the region where your workspace resides. Find your workspace and click DataStudio in the Actions column.
- Create a workflow. If you have an existing workflow, skip this step.
- Move the pointer over the icon and select Create Workflow.
- In the Create Workflow dialog box, configure the Workflow Name parameter.
- Click Create.
- Create a Hologres external table.
- Configure the Hologres external table. On the configuration tab of the Hologres external table, configure the parameters.
- Commit and deploy the Hologres external table. After the configuration of the Hologres internal table is complete, you can commit the table to the development and production environments. After the table is committed, you can query the table in the compute engine instance in the related environment.Note If you use a workspace in basic mode, you need to only commit the table to the production environment. For information about workspaces in basic and standard modes, see Differences between workspaces in basic mode and workspaces in standard mode.
Operation Description Load from development environment Load the table information from the development environment and display the table information on the current page. Note You can perform this operation only after the table is committed to the development environment. After you perform this operation, the table information in the development environment overwrites the table information on the current page.Submit to development environment Commit the table to the development environment. This way, you can create the current table in the Hologres database that you associate with your workspace in the development environment. After the table is committed, you can view the table schema in the Hologres folder of the related workflow in DataStudio. The folder is that you specified when you created the table.
Load from production environment Load the table information from the production environment and display the table information on the current page. Note You can perform this operation only after the table is committed to the production environment. After you perform this operation, the table information in the production environment overwrites the table information on the current page.Submit to production environment Commit the table to the production environment. This way, you can create the current table in the Hologres database that you associate with your workspace in the production environment.
What to do next
After the Hologres external table is created, you can use the table to import MaxCompute data to Hologres internal tables at regular intervals.- Import data by running commands. For more information, see Import data from MaxCompute to Hologres by executing SQL statements.
- Import data by performing related operations in the DataWorks console. For more information, see Create a node to synchronize MaxCompute data with a few clicks.