数据仓库服务 GAUSSDB(DWS)-表(Netezza):分布键

时间:2024-10-26 11:41:18

分布键

DISTRIBUTE ON (column)迁移为DISTRIBUTE BY HASH (column)。

Netezza语法

迁移后语法

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
CREATE TABLE  N_AG_AMT_H
(
     AG_NO                national character varying(50)    not null,
     AG_CATEG_CD      national character varying(12)    not null,
     AMT_TYPE_CD      national character varying(12)    not null,
     DATA_START_DT   date                                      not null,
     CCY_CD               national character varying(3)     not null,
     DATA_END_DT      date
)
DISTRIBUTE ON (AG_NO, AG_CATEG_CD, AMT_TYPE_CD)
ORGANIZE   ON (AG_CATEG_CD, AMT_TYPE_CD, DATA_END_DT)
;
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
CREATE TABLE  N_AG_AMT_H
(
     AG_NO                national character varying(50)    not null,
     AG_CATEG_CD      national character varying(12)    not null,
     AMT_TYPE_CD      national character varying(12)    not null,
     DATA_START_DT   date                                      not null,
     CCY_CD               national character varying(3)     not null,
     DATA_END_DT      date
) WITH(ORIENTATION=COLUMN)
DISTRIBUTE BY HASH (AG_NO, AG_CATEG_CD, AMT_TYPE_CD)
/* ORGANIZE   ON (AG_CATEG_CD, AMT_TYPE_CD, DATA_END_DT) */
;
support.huaweicloud.com/tg-dws/dws_07_6821.html