You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by liancheng <gi...@git.apache.org> on 2016/07/07 15:37:02 UTC

[GitHub] spark pull request #13765: [SPARK-16052][SQL] Improve `CollapseRepartition` ...

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

    https://github.com/apache/spark/pull/13765#discussion_r69930213
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/dsl/package.scala ---
    @@ -370,8 +370,11 @@ package object dsl {
             case plan => SubqueryAlias(alias, plan)
           }
     
    -      def distribute(exprs: Expression*): LogicalPlan =
    -        RepartitionByExpression(exprs, logicalPlan)
    +      def repartition(num: Integer): LogicalPlan =
    +        Repartition(num, shuffle = true, logicalPlan)
    +
    +      def distribute(exprs: Expression*)(n: Int = -1): LogicalPlan =
    +        RepartitionByExpression(exprs, logicalPlan, numPartitions = if (n < 0) None else Some(n))
    --- End diff --
    
    Seems that adding a `distribute(n: Int, exprs: Expression*)` overloading method is simpler?


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

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