Hive loading in partitioned table

前端 未结 5 631
长发绾君心
长发绾君心 2020-12-05 05:20

I have a log file in HDFS, values are delimited by comma. For example:

2012-10-11 12:00,opened_browser,userid111,deviceid222

Now I want to load

5条回答
  •  醉酒成梦
    2020-12-05 06:10

    1. As mentioned in @Denny Lee's answer, we need to involve a staging table(invites_stg) managed or external and then INSERT from staging table to partitioned table(invites in this case).

    2. Make sure we have these two properties set to:

      SET hive.exec.dynamic.partition=true;
      SET hive.exec.dynamic.partition.mode=nonstrict;
      
    3. And finally insert to invites,

      INSERT OVERWRITE TABLE India PARTITION (STATE) SELECT COL's FROM invites_stg;
      

    Refer this link for help: http://www.edupristine.com/blog/hive-partitions-example

提交回复
热议问题