プロダクト概要
製品の強み
適用シーン
CREATE TABLE [ IF NOT EXISTS ] table_identifier( col_name[:] col_type [ COMMENT col_comment ], ... )[ COMMENT table_comment ][ PARTITIONED BY ( col_name1, transform(col_name2), ... ) ]
table_identifier は三段式をサポートしています:catalog.db.name。col_type: primitive_type| nested_typeprimitive_type: boolean| int/integer| long/bigint| float| double| decimal(p,s),p=最大桁数,s=最大小数点桁数, s<=p<=38| date| timestamp,timestamp with timezone,timeとwithout timezoneはサポートされていません| string,Icebergのuuidタイプにも対応可能| binary,Icebergのfixedタイプにも対応可能nested_type: struct| list| map
transform: identity,任意のタイプをサポート, DLCはこの変換をサポートしていません| bucket[N]、ハッシュmod Nバケット、col_typeをサポート: int、long、decimal、date、timestamp、string、binary| truncate[L],Lによるバケット分割の切り捨て、サポートされるcol_type: int,long,decimal,string| years,年、サポートされるcol_type: date,timestamp| months,月、サポートされるcol_type: date,timestamp| days/date,日付、サポートされるcol_type: date,timestamphours/date_hour,時間,col_type: timestampをサポート
CREATE TABLE dempts(id bigint COMMENT 'id number',num int,eno float,dno double,cno decimal(9,3),flag boolean,data string,ts_year timestamp,date_month date,bno binary,point struct<x: double, y: double>,points array<struct<x: double, y: double>>,pointmaps map<struct<x: int>, struct<a: int>>)COMMENT 'table documentation'PARTITIONED BY (bucket(16,id), years(ts_year), months(date_month), identity(bno), bucket(3,num),truncate(10,data));
CREATE TABLE [ IF NOT EXISTS ] table_identifier[ COMMENT table_comment ][ PARTITIONED BY ( col_name1, transform(col_name2), ... ) ][ TBLPROPERTIES ( property_name=property_value, ... ) ]AS select_statement
CREATE TABLE dempts_copyCOMMENT 'table create as select'PARTITIONED BY (eno, dno)AS SELECT * from dempts;
CREATE [OR REPLACE] TABLE table_identifier[ COMMENT table_comment ][ PARTITIONED BY ( col_name1, transform(col_name2), ... ) ]AS select_statement
CREATE OR REPLACE TABLE dempts_replaceCOMMENT 'table create as replace'PARTITIONED BY (eno, dno)AS SELECT * from dempts;
DROP TABLE [ IF EXISTS ] table_identifier
ALTER TABLE table_identifier RENAME TO new_table_identifier
-- SET プロパティ構成の更新ALTER TABLE table_identifierSET TBLPROPERTIES (property_name=property_value, ...)-- UNSET プロパティ構成の削除ALTER TABLE table_identifierUNSET TBLPROPERTIES (property_name, ...)
-- SET プロパティ構成の更新ALTER TABLE dempts SET TBLPROPERTIES ('read.split.target-size'='268435456');-- UNSET プロパティ構成の削除ALTER TABLE dempts UNSET TBLPROPERTIES ('read.split.target-size'='268435456');
ALTER TABLE table_identifierWRITE [LOCALLY] ORDERED BY{col_name [ASC|DESC] [NULLS FIRST|LAST]}[, ...]
ALTER TABLE dempts WRITE ORDERED BY category, id;-- use optional ASC/DEC keyword to specify sort order of each field (default ASC)ALTER TABLE dempts WRITE ORDERED BY category ASC, id DESC;-- use optional NULLS FIRST/NULLS LAST keyword to specify null order of each field (default FIRST)ALTER TABLE dempts WRITE ORDERED BY category ASC NULLS LAST, id DESC NULLS FIRST;-- To order within each task, not across tasksALTER TABLE dempts WRITE LOCALLY ORDERED BY category, id;
ALTER TABLE table_identifierWRITE DISTRIBUTED BY PARTITION[ LOCALLY ORDERED BY{col_name [ASC|DESC] [NULLS FIRST|LAST]}[, ...]]
ALTER TABLE dempts WRITE DISTRIBUTED BY PARTITION;ALTER TABLE dempts WRITE DISTRIBUTED BY PARTITION LOCALLY ORDERED BY id;
-複数フィールドの追加ALTER TABLE table_identifierADD COLUMNS (col_name col_type [COMMENT col_comment], ...)-- 単一フィールドの追加ALTER TABLE table_identifierADD COLUMN col_name col_type [COMMENT col_comment][FIRST | AFTER target_col_name]
-複数フィールドの追加ALTER TABLE demptsADD COLUMNS (new_column_1 string comment 'new_column_1 docs',new_column_2 int comment 'new_column_2 docs');-- 単一フィールドの追加ALTER TABLE demptsADD COLUMN new_column_3 string comment 'new_column docs';
ALTER TABLE table_identifierRENAME COLUMN old_column_name TO new_column_name
ALTER TABLE table_identifierALTER COLUMN col_name{TYPE new_col_type | COMMENT col_comment}
ALTER TABLE dempts ALTER COLUMN new_column_2 TYPE bigint;ALTER TABLE dempts ALTER COLUMN new_column_2 comment 'alter docs';
ALTER TABLE table_identifier DROP COLUMN column_name
ALTER TABLE table_identifierADD PARTITION FIELD col_name|transform (col_name) [AS alias]
ALTER TABLE dempts ADD PARTITION FIELD new_column_1;ALTER TABLE dempts ADD PARTITION FIELD bucket(3,new_column_2);
ALTER TABLE table_identifier REPLACE PARTITION FIELD col_name|transform (col_name) [AS alias]
ALTER TABLE table_identifierDROP PARTITION FIELD col_name|transform (col_name);
ALTER TABLE dempts DROP PARTITION FIELD new_column_1;ALTER TABLE dempts DROP PARTITION FIELD bucket(3,new_column_2);
ALTER TABLE dempts SET IDENTIFIER FIELDS empno, name
ALTER TABLE dempts DROP IDENTIFIER FIELDS empno, name
フィードバック