Unioning Two Tables With Different Number Of Columns in Spark
<p>How do I union two dataframes A and B, containing different number of columns and get nulls for columns that are not common in dataframes A and B?</p>

<p>I can see that spark's <code>unionAll</code> doesn't support this action and throws following error</p>

<p><code>org.apache.spark.sql.AnalysisException: Union can only be performed on tables with the same number of columns, but the left table has 11 columns and the right has 10;</code></p>

<p>Spark version: 1.6.1</p>