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

    https://github.com/apache/spark/pull/19828#discussion_r153337049
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala ---
    @@ -2747,9 +2755,41 @@ class Dataset[T] private[sql](
        * @since 2.0.0
        */
       @scala.annotation.varargs
    -  def repartition(partitionExprs: Column*): Dataset[T] = withTypedPlan {
    -    RepartitionByExpression(
    -      partitionExprs.map(_.expr), logicalPlan, 
sparkSession.sessionState.conf.numShufflePartitions)
    +  def repartition(partitionExprs: Column*): Dataset[T] = {
    +    repartition(sparkSession.sessionState.conf.numShufflePartitions, 
partitionExprs: _*)
    +  }
    +
    +  /**
    +   * Returns a new Dataset partitioned by the given partitioning 
expressions into
    +   * `numPartitions`. The resulting Dataset is range partitioned.
    +   *
    +   * @group typedrel
    +   * @since 2.3.0
    +   */
    +  @scala.annotation.varargs
    +  def repartitionByRange(numPartitions: Int, partitionExprs: Column*): 
Dataset[T] = withTypedPlan {
    +    val sortOrder: Seq[SortOrder] = partitionExprs.map { col =>
    +      col.expr match {
    +        case expr: SortOrder =>
    +          expr
    +        case expr: Expression =>
    --- End diff --
    
    The error is slightly different because the project is whole stage code 
generated.


---

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

Reply via email to