Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

Commit a6fed07

Browse files
committed
[SPARK-8695] [core] [WIP] TreeAggregation shouldn't be triggered for 5 partitions
1 parent 75b9fe4 commit a6fed07

File tree

1 file changed

+3
-1
lines changed
  • core/src/main/scala/org/apache/spark/rdd

1 file changed

+3
-1
lines changed

core/src/main/scala/org/apache/spark/rdd/RDD.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,9 @@ abstract class RDD[T: ClassTag](
10781078
val scale = math.max(math.ceil(math.pow(numPartitions, 1.0 / depth)).toInt, 2)
10791079
// If creating an extra level doesn't help reduce
10801080
// the wall-clock time, we stop tree aggregation.
1081-
while (numPartitions > scale + numPartitions / scale) {
1081+
1082+
// Don't trigger treeAggregation for 5 partitions
1083+
while (numPartitions > 5 && (numPartitions > scale + numPartitions / scale)) {
10821084
numPartitions /= scale
10831085
val curNumPartitions = numPartitions
10841086
partiallyAggregated = partiallyAggregated.mapPartitionsWithIndex {

0 commit comments

Comments
 (0)