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

    https://github.com/apache/spark/pull/4228#discussion_r23706166
  
    --- Diff: core/src/main/scala/org/apache/spark/rdd/RDD.scala ---
    @@ -901,6 +901,38 @@ abstract class RDD[T: ClassTag](
       }
     
       /**
    +   * Reduces the elements of this RDD in a multi-level tree pattern.
    +   *
    +   * @param depth suggested depth of the tree (default: 2)
    +   * @see [[org.apache.spark.rdd.RDD#reduce]]
    +   */
    +  def treeReduce(f: (T, T) => T, depth: Int = 2): T = {
    --- End diff --
    
    It seems that this could be messy if we want to overload `treeAggregate`. 
The `aggregate` uses currying and class tag, both of which prevents overloading 
methods. I can remove currying, but the class tag seems to be necessary (to 
clone the `zeroValue`). `treeReduce` doesn't have this issue. 
    
    We do have some methods in `RDD.scala` with default arguments, e.g., 
`numPartitions`, `seed`, `ascending`, `preservesPartitioning`, etc. @pwendell 
@rxin Are you okay with keeping this default argument?


---
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