hive 动态插入时报错“Partition spec {…} contains non-partition columns”
hive 分区字段名 和 子查询名 必须一致insert overwrite table tttt partition (pt_dt)select 'aaaa' as a,pt_dtfrom t2上面哪条sql 是会报错的,因为 tttt 的分区字段 是dt 而不是pt_dt-- 改进insert overwrite table tttt partition (dt)select 'aaaa' a
·
hive 分区字段名 和 子查询名 必须一致
insert overwrite table tttt partition (pt_dt)
select 'aaaa' as a
,pt_dt
from t2
上面哪条sql 是会报错的,因为 tttt 的分区字段 是dt 而不是pt_dt
-- 改进
insert overwrite table tttt partition (dt)
select 'aaaa' as a
,pt_dt as dt
from t2
更多推荐
已为社区贡献1条内容
所有评论(0)