title: Block statements in if-else
body: <p>Hive supports conditional statements - <a href="https://cwiki.apache.org/Hive/languagemanual-udf.html#LanguageManualUDF-ConditionalFunctions" rel="nofollow">https://cwiki.apache.org/Hive/languagemanual-udf.html#LanguageManualUDF-ConditionalFunctions</a></p>
  
  <p>However, I wish to use a <strong>block</strong> 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.</p>
  
  <pre><code>SELECT 
  IF (B.id&lt;&gt;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)
  </code></pre>
  
  <p>The above query doesn't work. Is it because Hive doesn't support block conditional statements? How can I implement the above functionality?</p>