I have a dataframe with the following schema :
col1 as col1, col 2, col 3, . . col n
I have another dataframe with the following schema
col1 as diffName, col n+1, col n+2 . . .
how can i append values in col 1 of dataframe and the rest of the columns as null values?
i have tried using union as well as merge but to no avail



You could manually make the columns of both dataframes match, then union them. For example, with these dataframes:
The first step would be to make sure the column that is common to both dataframes has the same name:
Then you can make the columns match:
Finally, you can take the union. I find
unionByNameto be safer: