title: Hive - compare data between tables
body: <p>I need to compare data between 2 external tables (A and A') with the same columns and i actually make some sql scripts to do this but is not enough efficient and robust. there are a way to  do this with UDAF or external tools? </p>
  
  <p><strong>Here one sample:</strong></p>
  
  <p><strong>Table A</strong></p>
  
  <pre><code>+----+----+----+
  | C1 | C2 | C3 |
  +----+----+----+
  | 01 | A  | 02 |
  | 02 | B  | 03 |
  | 03 | C  | 04 |
  +----+----+----+
  </code></pre>
  
  <p><strong>Table A'</strong></p>
  
  <pre><code>+----+----+----+
  | C1 | C2 | C3 |
  +----+----+----+
  | 01 | B  | 02 |
  | 02 | B  | 03 |
  | 04 | D  | 04 |
  +----+----+----+
  </code></pre>
  
  <p><strong>Output</strong></p>
  
  <pre><code>+------+------+------+------+------+------+
  |  C1  |  C2  |  C3  | C1'  | C2'  | C3'  |
  +------+------+------+------+------+------+
  | 01   | A    | 02   | 01   | B    | 02   |
  | 03   | C    | 04   | null | null | null |
  | null | null | null | 04   | D    | 04   |
  +------+------+------+------+------+------+
  </code></pre>