数据仓库服务 GAUSSDB(DWS)-执行导入数据:示例

时间:2023-11-22 14:18:36

示例

创建一个名为product_info的表,示例如下:

 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
(
    product_price                integer        not null,
    product_id                   char(30)       not null,
    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)                   
) 
with (
orientation = column,
compression=middle
) 
DISTRIBUTE BY HASH (product_id);

执行以下命令将外表product_info_ext的数据导入到目标表product_info中:

1
INSERT INTO product_info SELECT * FROM product_info_ext;
support.huaweicloud.com/devg-820-dws/dws_04_0186.html