📜  将此 RDD 保存为序列化对象的 SequenceFile - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:59.495000             🧑  作者: Mango

代码示例1
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']