반응형
◾ 테이블 생성 (as select)
CREATE TABLE temp.kudu_cm_audits
PRIMARY KEY (audit_id)
STORED AS KUDU
TBLPROPERTIES ('kudu.num_tablet_replicas' = '1')
AS SELECT * FROM temp.cm_audits
;
◾ 테이블 생성 (range partition)
CREATE TABLE IF NOT EXISTS temp.kudu_sample(
gubun string,
seq int,
code string,
description string,
total_emp int,
salary int,
PRIMARY KEY(gubun,seq)
)
PARTITION BY RANGE(gubun)(
PARTITION VALUE = '20210712'
)
COMMENT 'table comm'
STORED AD kudu;
◾ 테이블 생성 (hash partition)
- hash 파티션 수 참고 (For large tables, prefer to use roughly 10 partitions per server in the cluster.)
- https://docs.cloudera.com/cdp-private-cloud-base/7.1.6/impala-reference/topics/impala-kudu-partitioning.html
CREATE TABLE IF NOT EXISTS temp.kudu_sample(
gubun string,
seq int,
code string,
description string,
total_emp int,
salary int,
PRIMARY KEY(gubun,seq)
)
PARTITION BY HASH PARTITIONS 50
COMMENT 'table comm'
STORED AD kudu;
◾ 파티션 추가
ALTER TABLE temp.kudu_sample ADD RANGE PARTITION VALUE = '20210713';
◾ 파티션 조회 (range)
SHOW RANGE PARTITION temp.kudu_sample;