Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17751#discussion_r113076902
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala ---
    @@ -1726,15 +1726,23 @@ class Dataset[T] private[sql](
         // 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.
    -    // MapType cannot be sorted.
    -    val sorted = 
Sort(logicalPlan.output.filterNot(_.dataType.isInstanceOf[MapType])
    -      .map(SortOrder(_, Ascending)), global = false, logicalPlan)
    +    // ordering deterministic. Note that MapTypes cannot be sorted and are 
explicitly pruned out
    +    // from the sort order.
    +    val sortOrder = logicalPlan.output
    +      .filterNot(_.dataType.existsRecursively(dt => 
dt.isInstanceOf[MapType]))
    --- End diff --
    
    How about calling `RowOrdering.isOrderable`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to