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