1.设置动态分区:

set hive.exec.dynamic.partition=true;
set hive.exec.dynamic.partition.mode=nonstrict;

 

2.覆盖数据

insert overwrite table table_name_tmp1 partition(inc_day )

select  date_format(inc_day,'yy-mm-dd") rpt_dy,

           ,

          ,

          , 

      ----表全部字段,包括分区字段inc_day

from table_name_tmp1  where inc_day > ='20181001'

-----将20181001及以后的rpt_dy字段数据全部更新了一下

 

这里数据有个坑,插入数据只按照我们select的值插入,不存在根绝更是要插入的表字段对应插入

 

相关文章:

  • 2021-08-26
  • 2022-12-23
  • 2021-12-16
  • 2022-12-23
  • 2022-12-23
  • 2022-02-17
  • 2022-02-21
猜你喜欢
  • 2022-12-23
  • 2021-12-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
相关资源
相似解决方案