save this rdd as a sequencefile of serialized objects

Solutions on MaxInterview for save this rdd as a sequencefile of serialized objects by the best coders in the world

showing results for - "save this rdd as a sequencefile of serialized objects"
Izzie
28 May 2020
1tmpFile = NamedTemporaryFile(delete=True)
2tmpFile.close()
3sc.parallelize([1, 2, 'spark', 'rdd']).saveAsPickleFile(tmpFile.name, 3)
4sorted(sc.saveAsPickleFile(tmpFile.name, 5).map(str).collect())
5# ['1', '2', 'rdd', 'spark']