Skip to content
Advertisement

How to combine two tables to get singel table in Hive

I have following tables and need to combine them in hive

enter image description here

Could any one please help me how can we achieve this. I tried date part with coalesce and it is fine. But fam part is not able to merge into single column.

Really appreciate your help.

Thanks, Babu

Advertisement

Answer

You can use full outer join. However, union with left joins often looks cleaner:

If you are happy with NULL instead of 0, then no COALESCE()s are needed at all.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement