aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorzsxwing <zsxwing@gmail.com>2014-04-23 22:36:02 -0700
committerReynold Xin <rxin@apache.org>2014-04-23 22:36:02 -0700
commit6ab7578067e3bb78b64f99fd67c97e9607050ffe (patch)
tree2e437302c6afda62b7c6e0801786e23337b2c4f2 /core
parent1d6abe3a4b58f28fc4e0e690e02c19b2568ce1ee (diff)
downloadspark-6ab7578067e3bb78b64f99fd67c97e9607050ffe.tar.gz
spark-6ab7578067e3bb78b64f99fd67c97e9607050ffe.tar.bz2
spark-6ab7578067e3bb78b64f99fd67c97e9607050ffe.zip
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
Diffstat (limited to 'core')
-rw-r--r--core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala6
1 files changed, 5 insertions, 1 deletions
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 d2b9ee4276..5efb4388f6 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)
+ }
}
/**