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

    https://github.com/apache/spark/pull/5208#discussion_r28394813
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/Exchange.scala ---
    @@ -19,24 +19,39 @@ package org.apache.spark.sql.execution
     
     import org.apache.spark.annotation.DeveloperApi
     import org.apache.spark.shuffle.sort.SortShuffleManager
    -import org.apache.spark.sql.catalyst.expressions
     import org.apache.spark.{SparkEnv, HashPartitioner, RangePartitioner, 
SparkConf}
     import org.apache.spark.rdd.{RDD, ShuffledRDD}
     import org.apache.spark.sql.{SQLContext, Row}
     import org.apache.spark.sql.catalyst.errors.attachTree
    -import org.apache.spark.sql.catalyst.expressions.{Attribute, RowOrdering}
    +import org.apache.spark.sql.catalyst.expressions._
     import org.apache.spark.sql.catalyst.plans.physical._
     import org.apache.spark.sql.catalyst.rules.Rule
     import org.apache.spark.util.MutablePair
     
    +object Exchange {
    +  /** Returns true when the ordering expressions are a subset of the key. 
*/
    +  def canSortWithShuffle(partitioning: Partitioning, desiredOrdering: 
Seq[SortOrder]): Boolean = {
    --- End diff --
    
    It will be good to also explain that we need the ordering expressions to be 
a subset of the key because we are taking advantage of `ShuffledRDD`'s 
`KeyOrdering` for sorting.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to