You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by rx...@apache.org on 2014/02/12 19:47:55 UTC
git commit: Merge pull request #589 from mengxr/index.
Updated Branches:
refs/heads/master e733d655d -> 2bea0709f
Merge pull request #589 from mengxr/index.
SPARK-1076: Convert Int to Long to avoid overflow
Patch for PR #578.
Author: Xiangrui Meng <me...@databricks.com>
Closes #589 and squashes the following commits:
98c435e [Xiangrui Meng] cast Int to Long to avoid Int overflow
Project: http://git-wip-us.apache.org/repos/asf/incubator-spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-spark/commit/2bea0709
Tree: http://git-wip-us.apache.org/repos/asf/incubator-spark/tree/2bea0709
Diff: http://git-wip-us.apache.org/repos/asf/incubator-spark/diff/2bea0709
Branch: refs/heads/master
Commit: 2bea0709f9a1597f3c0dcc68d7c0536f465b3640
Parents: e733d65
Author: Xiangrui Meng <me...@databricks.com>
Authored: Wed Feb 12 10:47:52 2014 -0800
Committer: Reynold Xin <rx...@apache.org>
Committed: Wed Feb 12 10:47:52 2014 -0800
----------------------------------------------------------------------
core/src/main/scala/org/apache/spark/rdd/RDD.scala | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-spark/blob/2bea0709/core/src/main/scala/org/apache/spark/rdd/RDD.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/org/apache/spark/rdd/RDD.scala b/core/src/main/scala/org/apache/spark/rdd/RDD.scala
index ec8e311..d4fc28f 100644
--- a/core/src/main/scala/org/apache/spark/rdd/RDD.scala
+++ b/core/src/main/scala/org/apache/spark/rdd/RDD.scala
@@ -873,7 +873,7 @@ abstract class RDD[T: ClassTag](
* won't trigger a spark job, which is different from [[org.apache.spark.rdd.RDD#zipWithIndex]].
*/
def zipWithUniqueId(): RDD[(T, Long)] = {
- val n = this.partitions.size
+ val n = this.partitions.size.toLong
this.mapPartitionsWithIndex { case (k, iter) =>
iter.zipWithIndex.map { case (item, i) =>
(item, i * n + k)