RDD.
treeAggregate
Aggregates the elements of this RDD in a multi-level tree pattern.
New in version 1.3.0.
the initial value for the accumulated result of each partition
a function used to accumulate results within a partition
an associative function used to combine results from different partitions
suggested depth of the tree
the aggregated result
See also
RDD.aggregate()
RDD.treeReduce()
Examples
>>> add = lambda x, y: x + y >>> rdd = sc.parallelize([-5, -4, -3, -2, -1, 1, 2, 3, 4], 10) >>> rdd.treeAggregate(0, add, add) -5 >>> rdd.treeAggregate(0, add, add, 1) -5 >>> rdd.treeAggregate(0, add, add, 2) -5 >>> rdd.treeAggregate(0, add, add, 5) -5 >>> rdd.treeAggregate(0, add, add, 10) -5