I have insert overwrite query in HIVE 1.2.1 version
. I want to use Update instead of Insert overwrite in HIVE.
Can someone suggest or give an example in HIVE Update? Below is sample Insert Overwrite query I used.
Insert overwrite table temporary_table
select distinct
stg.col1,
stg.col2,
stg.col3,
case when tgt.cr_ts is Null then from_unixtime(unix_timestamp()) else cast(tgt.cr_ts as string) end as cr_ts ,
case when ( stg.col1=tgt.col1 and
stg.col2=tgt.col2 and
stg.col3= tgt.col3 )
then cast(tgt.last_updt_ts as string) else cast (from_unixtime(unix_timestamp()) as string )end as last_updt_ts
from stage_table stg
left outer join target_table tgt
On ( stg.col1= tgt.col1);