Skip to content

Commit fc8b10d

Browse files
mengxrJames Z.M. Gao
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 <[email protected]> Closes apache#589 and squashes the following commits: 98c435e [Xiangrui Meng] cast Int to Long to avoid Int overflow
1 parent 0659fbb commit fc8b10d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • core/src/main/scala/org/apache/spark/rdd

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

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

0 commit comments

Comments
 (0)