我有一个 Hive 临时表,没有任何具有所需数据的分区。我想选择这些数据并插入到另一个按日期分区的表中。我尝试了以下技术但没有运气。
源表架构
CREATE TABLE cls_staging.cls_billing_address_em_tmp
( col1 string,
col2 string,
col3 string);
目的地表:
CREATE TABLE cls_staging.cls_billing_address_em_tmp
( col1 string,
col2 string,
col3 string)
PARTITIONED BY (
curr_date string)
STORED AS ORC;
查询插入目标表:
insert overwrite table cls_staging.cls_billing_address_em_tmp partition (record_date) select col1, col2, col3, FROM_UNIXTIME(UNIX_TIMESTAMP()) from myDB.mytbl;
错误
Dynamic partition strict mode requires at least one static partition column
第二
insert overwrite table cls_staging.cls_billing_address_em_tmp partition (record_date = FROM_UNIXTIME(UNIX_TIMESTAMP())) select col1, col2, col3 from myDB.mytbl;
错误 :
cannot recognize input near 'FROM_UNIXTIME' '(' 'UNIX_TIMESTAMP'