spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject git commit: SPARK-1589: Fix the incorrect compare
Date Thu, 24 Apr 2014 05:36:05 GMT
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 <zsxwing@gmail.com>

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 <zsxwing@gmail.com>
Authored: Wed Apr 23 22:36:02 2014 -0700
Committer: Reynold Xin <rxin@apache.org>
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)
+    }
   }
 
   /**


Mime
View raw message