数据仓库服务 GAUSSDB(DWS)-PARTITION:RANGE_N with * for end-date

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

RANGE_N with * for end-date

输入:

CREATE SET TABLE Orders4 (
   StoreNo SMALLINT, 
   OrderNo INTEGER, 
   OrderDate DATE, 
   OrderTotal INTEGER 
) 
PRIMARY INDEX(OrderNo) 
PARTITION BY RANGE_N  (
   OrderDate BETWEEN DATE '2010-01-01' AND '2016-12-31' EACH INTERVAL '1' YEAR,
     DATE '2017-01-01' EACH INTERVAL '1' MONTH,
     DATE '2019-01-01' AND * 
);

输出

CREATE TABLE Orders4 (
   StoreNo SMALLINT, 
   OrderNo INTEGER, 
   OrderDate DATE, 
   OrderTotal INTEGER 
) 
DISTRIBUTE BY HASH (OrderNo) 
PARTITION BY RANGE (OrderDate)
   ( PARTITION Orders4_0 START (DATE '2010-01-01') END (DATE '2016-12-31') EVERY (INTERVAL '1' YEAR),
PARTITION Orders4_1 START (DATE '2016-12-31') END (DATE '2020-01-01') EVERY (INTERVAL '1' MONTH) ,
PARTITION Orders4_2 START (DATE '2020-01-01') END (MAXVALUE)
);
support.huaweicloud.com/tg-dws/dws_16_0072.html