Skip to content

Commit 2bea070

Browse files
mengxrrxin
authored andcommitted
Merge pull request apache#589 from mengxr/index.
SPARK-1076: Convert Int to Long to avoid overflow Patch for PR apache#578. Author: Xiangrui Meng <meng@databricks.com> Closes apache#589 and squashes the following commits: 98c435e [Xiangrui Meng] cast Int to Long to avoid Int overflow
1 parent e733d65 commit 2bea070

File tree

1 file changed

+1
-1
lines changed
  • core/src/main/scala/org/apache/spark/rdd

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ abstract class RDD[T: ClassTag](
873873
* won't trigger a spark job, which is different from [[org.apache.spark.rdd.RDD#zipWithIndex]].
874874
*/
875875
def zipWithUniqueId(): RDD[(T, Long)] = {
876-
val n = this.partitions.size
876+
val n = this.partitions.size.toLong
877877
this.mapPartitionsWithIndex { case (k, iter) =>
878878
iter.zipWithIndex.map { case (item, i) =>
879879
(item, i * n + k)

0 commit comments

Comments
 (0)