You can use HoloWeb to import data from an Object Storage Service (OSS) table to a Hologres internal table in a visualized manner for data queries. Compared with the method of creating foreign tables for data queries, this method provides better query performance.
Prerequisites
You have logged on to a Hologres instance. For more information, see Log on to an instance.
A foreign server is created. For more information, see Create a foreign server.
Procedure
Log on to the Hologres console.
In the top navigation bar, select a region.
In the left-side navigation pane, click Go to HoloWeb.
Log on to the destination database. In the main menu bar, choose Metadata Management > OSS Data Lake Acceleration > One-click OSS Data Import.
On the page that appears, configure the parameters. The SQL Script automatically generates SQL statements based on the parameter configurations. The following table describes the parameters.
Section
Parameter
Description
Instance
Instance Name
The name of the instance.
Source DLF Table
Server Name
The name of the created foreign server.
Database Name
The name of the Data Lake Formation (DLF) database in which the OSS data you want to import resides.
Table Name
The name of the OSS table from which you want to import data.
Destination Hologres Table
Database Name
The name of the destination Hologres database to which you want to import data.
Schema Name
The default value is public. You can select another schema on which you have permissions from the drop-down list.
Table Name
The name of the Hologres internal table that you want to create.
You do not need to manually create a Hologres internal table. After you configure the Table Name parameter in the Source DLF Table section, the same value is automatically specified for this parameter. You can also rename the Hologres internal table.
If a Hologres internal table that has the same name already exists, the following rules apply:
Non-partitioned table: The system deletes the existing table and data and creates another table.
Partitioned table: The system creates a child partitioned table based on the partition key value and inserts data to the child partitioned table. The existing table and data are not deleted. If the schema of the DLF table is different from the schema of the existing internal table, an error is reported.
Destination Table Description
The description of the Hologres internal table that you want to create. You can enter a custom description.
Parameter Settings
GUC Parameters
The GUC parameters that you must configure.
In most cases, the GUC parameters are used to control the parallelism of data read and write jobs. Configure GUC parameters by using the
set <GUC>=<values>;syntax. If you want to configure multiple GUC parameters, make sure that each GUC parameter is in a different line.Import Task
Fields
The fields that you want to import from the DLF table.
You can import specific fields or all fields in the DLF table.
Partition Configurations
Partition Field: Select a partition field from the drop-down list.
Data Timestamp: If the DLF table is partitioned by date, you can select a date. The system imports data in the partition with the specified date to the Hologres table.
Property
Storage Mode:
Column-oriented Storage: This mode is suitable for complex queries.
Row-oriented Storage: This mode is suitable for point queries and scans based on primary keys.
Row-column Storage: This mode is suitable for multiple scenarios, such as complex online analytical processing (OLAP) queries, high-concurrency point queries, and point queries that are not based on primary keys.
If you do not configure this parameter, the column-oriented storage mode is used.
For more information, see Storage modes of tables: row-oriented storage, column-oriented storage, and row-column hybrid storage.
Data Lifecycle: the lifecycle of table data. Default value: Maximum. If the data is not updated within the specified period, the system deletes the data after the period expires.
Binlog: Specifies whether to enable the binary logging feature for the table. For more information, see Subscribe to Hologres binary logs.
NoteHologres V0.9 and later support subscription to the binary logs of a single table.
Lifecycle of Binary Logs: the time to live (TTL) of binary logs. Unit: seconds. Default value: 2592000 (30 days). For more information, see Subscribe to Hologres binary logs.
Then, you can configure properties for the DLF table fields that you want to import. For example, you can configure distribution columns, event time columns, clustering key columns, dictionary encoding columns, or bitmap columns.
In the upper-right corner of the page, click Submit. On the One-click OSS Data Import page, you can view the execution details of the data import task.
Optional. Find the import task and click the following options in the Actions column to perform the operations based on your business requirements: Details, Rerun, Delete, and Execution History.
Query OSS data
After you execute the data import task, Hologres automatically generates an internal table. You can execute the following SQL statement in Hologres to query data:
SELECT * FROM <tablename>;In the preceding statement, tablename indicates the name of the Hologres internal name that is specified when you create the import task.