Help Center/
Data Warehouse Service /
Data Migration and Synchronization/
Importing Data/
Using the LakeFormation Data Source to Import Data/
Importing Data
Updated on 2025-09-19 GMT+08:00
Importing Data
Creating a LakeFormation Data Source
Create a LakeFormation data source. For details, see section "Managing LakeFormation Data Sources" in Data Warehouse Service (DWS) User Guide.
Creating an External Schema
Create an external schema. Set Server Name to the name of the created LakeFormation data source, DATABASE to the LakeFormation database to be accessed, Source to lakeformation, and Catalog to the catalog of the LakeFormation database to be accessed.
1 2 3 4 5 6 |
DROP SCHEMA IF EXISTS ex1; CREATE EXTERNAL SCHEMA ex1 WITH SOURCE lakeformation DATABASE 'default' SERVER lf_server catalog 'hive'; |
Role Authorization
Importing Data
- Create a local table for data import.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
DROP TABLE IF EXISTS product_info; CREATE TABLE product_info ( _hoodie_commit_time text, _hoodie_commit_seqno text, _hoodie_record_key text, _hoodie_partition_path text, _hoodie_file_name text, product_price integer , product_id char(30) , product_time date , product_level char(10) , product_name varchar(200) , product_type1 varchar(20) , product_type2 char(10) , product_monthly_sales_cnt integer , product_comment_time date , product_comment_num integer , product_comment_content varchar(200) ) ;
- Import the target table from the Hive table.
1
INSERT INTO product_info SELECT * FROM ex1.product_info_orc;
- Query the import result.
1
SELECT * FROM product_info;
Parent topic: Using the LakeFormation Data Source to Import Data
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot