我在HIVE 1.2.1 version
中插入了覆盖查询。我想在HIVE中使用Update而不是Insert overwrite。
有人可以建议或举例说明HIVE更新吗?下面是我使用的示例Insert Overwrite查询。
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);