We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 97de852 commit decba82Copy full SHA for decba82
core/src/main/scala/org/apache/spark/rdd/CoalescedRDD.scala
@@ -78,7 +78,8 @@ private[spark] class CoalescedRDD[T: ClassTag](
78
balanceSlack: Double = 0.10)
79
extends RDD[T](prev.context, Nil) { // Nil since we implement getDependencies
80
81
- require(maxPartitions > 0, s"Number of partitions ($maxPartitions) must be positive.")
+ require(maxPartitions > 0 || maxPartitions == prev.partitions.length,
82
+ s"Number of partitions ($maxPartitions) must be positive.")
83
84
override def getPartitions: Array[Partition] = {
85
val pc = new PartitionCoalescer(maxPartitions, prev, balanceSlack)
0 commit comments