Answers for "Save this RDD as a SequenceFile of serialized objects"

0

Save this RDD as a SequenceFile of serialized objects

tmpFile = NamedTemporaryFile(delete=True)
tmpFile.close()
sc.parallelize([1, 2, 'spark', 'rdd']).saveAsPickleFile(tmpFile.name, 3)
sorted(sc.saveAsPickleFile(tmpFile.name, 5).map(str).collect())
# ['1', '2', 'rdd', 'spark']
Posted by: Guest on March-12-2020

Code answers related to "Save this RDD as a SequenceFile of serialized objects"

Python Answers by Framework

Browse Popular Code Answers by Language