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()
CodePudding user response:
You can convert dataset to dataframe using toDF()
:
mergeDF_A.union(mergeDF_B).toDF()