在Z上和开放平台上的创建方法还不太一样,两套人马开发出来的就是牛!
蛋疼……
贴不同类型的几个例子感受一下,Z上的ASC,DESC不见了:
CREATE TABLE foo(a INT) PARTITION BY RANGE (a) (STARTING FROM (1) ENDING AT (100) EVERY (20))
CREATE TABLE lineitem ( l_orderkey DECIMAL(10,0) NOT NULL, l_quantity DECIMAL(12,2), l_shipdate DATE, l_year_month INT GENERATED ALWAYS AS (YEAR(l_shipdate)*100 + MONTH(l_shipdate))) PARTITION BY RANGE(l_shipdate) (STARTING (‘1/1/1992‘) ENDING (‘12/31/1992‘) EVERY 1 MONTH);
CREATE TABLE t(a INT, b INT) PARTITION BY RANGE(b) (STARTING FROM (1) EXCLUSIVE ENDING AT (1000) EVERY (100))
CREATE TABLE lineitem2 ( l_orderkey DECIMAL(10,0) NOT NULL, l_quantity DECIMAL(12,2), l_shipdate TIMESTAMP, l_year_month INT GENERATED ALWAYS AS (YEAR(l_shipdate)*100 + MONTH(l_shipdate))) PARTITION BY RANGE(l_shipdate) (STARTING (‘1992-01-01-00.00.00.000000‘) ENDING (‘1992-12-31-23.59.59.999999‘) EVERY 1 MONTH)
CREATE TABLE lineitem3 ( l_orderkey DECIMAL(10,0) NOT NULL, l_quantity DECIMAL(12,2), l_shipdate TIMESTAMP, l_year_month INT GENERATED ALWAYS AS (YEAR(l_shipdate)*100 + MONTH(l_shipdate))) PARTITION BY RANGE(l_shipdate) (STARTING (‘1/1/1992‘) ENDING (‘12/31/1992‘) EVERY 1 MONTH)
CREATE TABLE sales(invoice_date date, inv_month int NOT NULL GENERATED ALWAYS AS (month(invoice_date)), inv_year INT NOT NULL GENERATED ALWAYS AS ( year(invoice_date)), item_id int NOT NULL, cust_id int NOT NULL) PARTITION BY RANGE (inv_year, inv_month) (PART Q1_02 STARTING (2002,1) ENDING (2002, 3) INCLUSIVE, PART Q2_02 ENDING (2002, 6) INCLUSIVE, PART Q3_02 ENDING (2002, 9) INCLUSIVE, PART Q4_02 ENDING (2002,12) INCLUSIVE, PART CURRENT ENDING (MAXVALUE, MAXVALUE));
CREATE TABLE foo(a INT) PARTITION BY RANGE(a) (STARTING FROM (1) ENDING AT (100), STARTING FROM (201) ENDING AT (300))
时间: 2024-10-06 14:52:20