title: Merge a Spark data frame into an existing ACID transactional Hive table?
body: <p>Consider a simple merge statement in Hive:</p>
  <pre><code>merge into
    base_table A 
  using
    merge_from_table B 
  on
    (A.id = B.id)
  when matched then update set 
    A.lastname = B.lastname 
  </code></pre>
  <p>Now imagine:</p>
  <ol>
  <li>base_table is a transactional Hive table (ACID operations
  enabled).</li>
  <li>instead of merge_from_table we have a data frame that is produced
  in Spark</li>
  </ol>
  <p><strong>Question 1:</strong>
  Is there any way to directly merge the data frame into the Hive table?</p>
  <p>If the answer to Question 1 is &quot;no&quot;, then:</p>
  <p><strong>Question 2:</strong> Right now the best I can think of is to write the data frame into a temporary hive table and then use the above Hive statement to merge into my base_table. Is there a better way to do it?</p>