有没有一种使用pyspark计算Apache Spark数据框大小的字节数的方法?
df.count()
df.write.option("maxRecordsPerFile", 10000).save(file/path/)
repartition
df.cache()
df.count()
轻松找出您正在处理的行数,然后使用df.write.option("maxRecordsPerFile", 10000).save(file/path/)
获取您想要的确切输出文件数量。它还可以帮助您节省非常昂贵的repartition
。这会有所帮助吗? - Omar