title: Insert data into selected columns in HIVE from another table
body: <p>I have 2 hive tables, one with lots of columns and data the other with some matching columns some non-matching. </p>
  
  <p>I want to be able to insert data from the first table and specify the columns to insert it into for example:</p>
  
  <p>Table 1(fruit):
  <strong>Apples</strong> <em>string</em>,
  <strong>Oranges</strong> <em>string</em>,
  <strong>Pears</strong> <em>string</em>,
  <strong>Grapes</strong> <em>string</em>,
  <strong>Kiwi</strong> <em>string</em>;</p>
  
  <p>Table 2 (fruitAndVeg):
  <strong>Pears</strong> <em>string</em>,
  <strong>Carrot</strong> <em>string</em>,
  <strong>Kiwi</strong> <em>string</em>;</p>
  
  <p>I want an insert statement close to the following:</p>
  
  <pre><code>insert overwrite table fruitAndVeg x (x.Pears, x.kiwi) select y.Pears, y.kiwi from fruit y;
  </code></pre>
  
  <p>I know that the code below is possible but I have a lot more data in my tables so trying to specify the columns rather than insert nulls or empty strings in manually:</p>
  
  <pre><code>insert overwrite table fruitAndVeg select y.Pears, emptystring, y.kiwi from fruit y;
  </code></pre>
  
  <p>Any help is appreciated.</p>
  
  <p>NB. Can also use Impala if that is easier.</p>