1
treeAggregateはどのようにして最大限の最小限の機能を実現するのですか?表現TreeAggregate In Spark
{
math.max(U, v)
U
}
の
scala> val z = sc.parallelize(List(1, 2, 3, 4, 5, 6), 2)
z: org.apache.spark.rdd.RDD[Int] = ParallelCollectionRDD[0] at parallelize at <console>:24
scala> z.treeAggregate(0)(
| math.max(_, _), math.max(_, _)
|)
res0: Int = 6
scala> z.treeAggregate(0)(
| seqOp = (U, v) => {
| math.max(U, v)
| U
| },
| combOp = (U1, U2) => {
| math.max(U1, U2)
| U1
| })
res1: Int = 0