Back
I have 2 DataFrames as followed :
DataFrame
I need union like this:
The unionAll function doesn't work because the number and the name of columns are different.
unionAll
How can I do this?
Using Scala, you just have to append all missing columns as nulls, as given below:
Now, the unionALl function will work:
If you want to know more about Spark, then do check out this awesome video tutorial:
31k questions
32.8k answers
501 comments
693 users