Repository: spark Updated Branches: refs/heads/master 1d6abe3a4 -> 6ab757806
SPARK-1589: Fix the incorrect compare JIRA: https://issues.apache.org/jira/browse/SPARK-1589 Author: zsxwing <[email protected]> Closes #508 from zsxwing/SPARK-1589 and squashes the following commits: 570c67a [zsxwing] SPARK-1589: Fix the incorrect compare Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/6ab75780 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/6ab75780 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/6ab75780 Branch: refs/heads/master Commit: 6ab7578067e3bb78b64f99fd67c97e9607050ffe Parents: 1d6abe3 Author: zsxwing <[email protected]> Authored: Wed Apr 23 22:36:02 2014 -0700 Committer: Reynold Xin <[email protected]> Committed: Wed Apr 23 22:36:02 2014 -0700 ---------------------------------------------------------------------- .../src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/6ab75780/core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala ---------------------------------------------------------------------- diff --git a/core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala b/core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala index d2b9ee4..5efb438 100644 --- a/core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala +++ b/core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala @@ -292,7 +292,11 @@ class PairRDDFunctions[K, V](self: RDD[(K, V)]) if (keyClass.isArray && partitioner.isInstanceOf[HashPartitioner]) { throw new SparkException("Default partitioner cannot partition array keys.") } - if (self.partitioner == partitioner) self else new ShuffledRDD[K, V, (K, V)](self, partitioner) + if (self.partitioner == Some(partitioner)) { + self + } else { + new ShuffledRDD[K, V, (K, V)](self, partitioner) + } } /**
