Skip to content
Advertisement

HIVE Query: How to select the ‘join key’ for “FULL OUTER JOIN”?

I got the following error:

from the SPARK/HIVE query:

Since I am using FULL OUTER JOIN, business_id could be either p.business_id or s.business_id, so I didn’t specify which one to use. (I thought some rows might have only p.business_id while some other rows might have only s.business_id, do I understand this wrong?)

So I am wondering what’s the proper way to select business_id in the above query? Thanks!

Advertisement

Answer

Use

Or

Or CASE statements like in this answer: https://stackoverflow.com/a/37744071/2700344

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