[log] 2023-09-27 非分区表变分区表

2023-09-26  本文已影响0人  麒麟楚庄王

https://community.cloudera.com/t5/Support-Questions/How-to-create-partitions-on-existing-Hive-table/td-p/241684

CREATE TABLE lkml.lk_opr_ar_model_monitor_xbsp_auditcode_log_pt

(

RISKCODE STRING,

CNT BIGINT

)

PARTITIONED BY (DT STRING);

insert overwrite table lkml.lk_opr_ar_model_monitor_xbsp_auditcode_log_pt partition(dt)

select riskcode,cnt,dt

from lkml.lk_opr_ar_model_monitor_xbsp_auditcode_log

--distribute by dt --这里可以不写distribute by

上一篇下一篇

猜你喜欢

热点阅读