Skip to content
Advertisement

Hive Union of two queries is giving compile error

I am not sure what is wrong with following hive query. However, it’s throwing error.

I am able to run this queries individually. However, facing issues while running with union

Error

Advertisement

Answer

Hive versions prior to 1.2.0 only support UNION ALL

Workaround: Use UNION ALL instead of UNION, wrap all into subquery and apply distinct

UNION is the same as UNION ALL + DISTINCT

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