Details
Description
In randomSplit, It is possible that the underlying dataframe doesn't guarantee the ordering of rows in its constituent partitions each time a split is materialized which could result in overlapping splits.
To prevent this, we explicitly sort each input partition to make the ordering deterministic. Given that MapTypes cannot be sorted they should be explicitly pruned out from the sort order. Additionally, if the resulting sort order is empty, we then materialize the dataset to guarantee determinism.