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
Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐