Update , SET option in Hive

后端 未结 2 577
花落未央
花落未央 2020-12-03 00:22

I know there is no update of file in Hadoop but in Hive it is possible with syntactic sugar to merge the new values with the old data in the table and then to rewrite the ta

2条回答
  •  感情败类
    2020-12-03 00:42

    This may be hacky but it's worked for somethings I've had to do at work.

        INSERT OVERWRITE TABLE tabletop PARTITION(partname = 'valueIwantToSet')
        SELECT things FROM databases.tables WHERE whereclause;
    

    As you might expect this breaks your data up into partitions, but if the distribution of the value you want to set is proportional to "good data chunk sizes" (this is up to you to design) then your queries on that data will be better optimized

    @Jothi: Could you please post the query you used?

提交回复
热议问题