I have 2 data frames that I try to perform unionAll on.
DF3=DF1.unionAll(DF2)
DF3.coalesce(1).write.csv("/location")
DF1 always is placed under DF2 after coalesce and I see the reason is because the smaller partitions comes last as per this: https://stackoverflow.com/a/59838761/3357735 .
Is there any way that we can have the same order as my union? is DF1 comes first and DF2 after coalesce.