Skip to content

Commit 6ab7578

Browse files
zsxwingrxin
authored andcommitted
SPARK-1589: Fix the incorrect compare
JIRA: https://issues.apache.org/jira/browse/SPARK-1589 Author: zsxwing <zsxwing@gmail.com> Closes #508 from zsxwing/SPARK-1589 and squashes the following commits: 570c67a [zsxwing] SPARK-1589: Fix the incorrect compare
1 parent 1d6abe3 commit 6ab7578

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,11 @@ class PairRDDFunctions[K, V](self: RDD[(K, V)])
292292
if (keyClass.isArray && partitioner.isInstanceOf[HashPartitioner]) {
293293
throw new SparkException("Default partitioner cannot partition array keys.")
294294
}
295-
if (self.partitioner == partitioner) self else new ShuffledRDD[K, V, (K, V)](self, partitioner)
295+
if (self.partitioner == Some(partitioner)) {
296+
self
297+
} else {
298+
new ShuffledRDD[K, V, (K, V)](self, partitioner)
299+
}
296300
}
297301

298302
/**

0 commit comments

Comments
 (0)