Hello All,

I have a use case in RDBMS query which I have implemented in
HIVE as..



*1.1) Update statement* *in RDBMS*

update  TABLE1
set
Age= case when isnull(age,'') ='' then 'A= Current' else '240+ Days' end,
Prev_Age=case when isnull(prev_age,'') ='' then 'A= Current' else '240+
Days' end;
*1.2) Update statement* *in HIVE*

create table  TABLE2 as select
a.* ,
case when coalesce(a.age,'')='' then 'A=Current' else '240+ Days' end as
Age,
case when coalesce(a.prev_age,'')='' then 'A=Current' else '240+ Days' end
as Prev_age from TABLE1 a ;





*Now I have a case statement in which I have a join condition*.



*2) Join in RDBMS*
update  TABLE1
set a.Age = c.sys_buscd_item_desc1
from  TABLE1 a
join  TABLE2 c
on c.sys_type_cd='AGE'
where isnull(a.age,'00')=c.sys_item;
commit;





How can I implement this query into Hive, Pls help and suggest.



Thanks In Advance

Yogesh Kumar

Reply via email to