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

    https://github.com/apache/spark/pull/19828#discussion_r153244046
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala ---
    @@ -448,8 +448,15 @@ abstract class SparkStrategies extends 
QueryPlanner[SparkPlan] {
           case r: logical.Range =>
             execution.RangeExec(r) :: Nil
           case logical.RepartitionByExpression(expressions, child, 
numPartitions) =>
    -        exchange.ShuffleExchangeExec(HashPartitioning(
    -          expressions, numPartitions), planLater(child)) :: Nil
    +        // RepartitionByExpression's constructor verifies that either all 
expressions are
    +        // of type SortOrder, in which case we're doing RangePartitioning, 
or none of them are,
    +        // in which case we're doing HashPartitioning.
    +        val partitioning = if 
(expressions.forall(_.isInstanceOf[SortOrder])) {
    --- End diff --
    
    Oh, and it also makes it easier to unit test this code :)


---

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

Reply via email to