title: Dynamic hive view creation
body: <p>I have 10 hive tables, few columns might be similar in few tables, I need to union them into one table. I was writing Union all statements.</p>
  <p>Now, these columns in these 10 tables might change . how to create the Union all query dynamically based on the tables.</p>
  <pre><code>CREATE VIEW comb_view AS
  SELECT col11, col12, col13,.....
  From
  (SELECT col11,col12,NULL col13 from tab1
  UNION ALL
  SELECT col11,NULL col12, col13 from tab2
  .
  .
  .
  .
  ) c
  </code></pre>
  <p>ensuring the position and data type.</p>