I have two tables which are pretty wide (30 columns) but have very similar schema (20+ columns shared across both tables). I want to union those two tables together but want the new table to have all the fields from both tables. 

Similar to the idea from [this Stackoverflow question](https://stackoverflow.com/questions/2309943/unioning-two-tables-with-different-number-of-columns).

However, the challenges arise when I start writing the queries that I have to specify all the columns from each table and not only that, but also use NULL to fill in the columns that is only present from the other table. 

Like this: 

```
select
    commoncolumn1, 
    commoncolumn2, 
    table1_only_column1, 
    NULL as table2_only_column1
    ...
from table1
union all 
select
    commoncolumn1, 
    commoncolumn2, 
    NULL as table1_only_column1, 
    table2_only_column1
    ...

```

from table2

This query gets really long as the number of columns increases and also not quite robust to schema changes. Is there a better way of union two tables which auto fill NULLs for non-present tables? 

I am using Impala/Hive but if there is an ANSI way of doing this, that will be great!