Skip to content

Commit 5a7b370

Browse files
committed
Only group elements ten at a time into SequenceFile records in
saveAsObjectFile
1 parent 3d24281 commit 5a7b370

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/scala/spark/RDD.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ abstract class RDD[T: ClassManifest](@transient sc: SparkContext) extends Serial
256256
}
257257

258258
def saveAsObjectFile(path: String) {
259-
this.glom
259+
this.mapPartitions(iter => iter.grouped(10).map(_.toArray))
260260
.map(x => (NullWritable.get(), new BytesWritable(Utils.serialize(x))))
261261
.saveAsSequenceFile(path)
262262
}

0 commit comments

Comments
 (0)