title: Join in Hive with Concatenated Columns
body: <p>I have 2 tables I need to join in Hive on a key that is created by concatenating 2 columns in each table (the ID and State columns below). Below is an example of my data:</p>
  
  <p>Table 1:</p>
  
  <pre><code>ID State Year Name
  1234 VA 2019 Liz
  2345 MI 2018 Pat
  5656 OH 2018 Meg
  1562 MI 2019 John
  1234 OH 2018 Sam
  2345 PA 2019 George
  </code></pre>
  
  <p>Table 2:</p>
  
  <pre><code>ID State Salary Age
  1562 MI 32 37
  2345 PA 60 70
  5616 MI 52 82
  1234 VA 50 35
  2345 MI 60 45
  5656 OH 45 40
  1234 OH 52 52
  </code></pre>
  
  <p>I need perform a left join using a key that is created by concatenating the "ID" and "State" columns. The output should be as follows:</p>
  
  <pre><code>ID State Year Name Salary Age
  1234 VA 2019 Liz 50 35
  2345 MI 2018 Pat 60 45
  5656 OH 2018 Meg 45 40
  1562 MI 2019 John 32 37
  1234 OH 2018 Sam 52 50
  2345 PA 2019 George 60 70
  </code></pre>
  
  <p>Thank you!</p>