Hive supports conditional statements - https://cwiki.apache.org/Hive/languagemanual-udf.html#LanguageManualUDF-ConditionalFunctions
However, I wish to use a block conditional statements. For example, I have two tables A and B that have similar columns (although column names aren't identical). I wish to create a new table from A and B such that B has higher priority. So, if a row is present in B, I wish to select it from B, else select the row from A. i.e.
SELECT
IF (B.id<>NULL,
(B.id as id,
B.value1 as value),
(A.id as id,
a.value2 as value))
FROM A FULL OUTER JOIN B ON (A.id = B.id)
The above query doesn't work. Is it because Hive doesn't support block conditional statements? How can I implement the above functionality?