刚刚在插入回溯数据发现了问题
insert into temp partition ( day_id=20210928 )
select t.values1,t.values2 ,values3 ,day_id from temp1 t
如上面的代码 插入数据的时候会报错,如何把temp1的day_id字段当做参数插入到temp分区中呢?
因为有大量的数据需要回溯,一条条的去改day_id不现实
字段是varchar类型吧,需要加引号。
try this
insert into temp partition ( day_id='20210928' )
select t.values1,t.values2 ,values3 from temp1 t where t.day_id = '20210928'