Reputation: 55
There are two dataframes mergeDF_A and mergeDF_B. The below union action is giving a dataset instead of dataframe. Why is it returning a dataset? And how to get a dataframe?
val finalMergeDF = mergeDF_A.union(mergeDF_B).distinct()
Upvotes: 0
Views: 128
Reputation: 9504
You can convert dataset to dataframe using toDF()
:
mergeDF_A.union(mergeDF_B).toDF()
Upvotes: 1