我在 emr 中使用 Jupyter notebook 来处理大量数据。在处理数据时,我看到了这个错误:
An error occurred while calling z:org.apache.spark.api.python.PythonRDD.collectAndServe.
: org.apache.spark.SparkException: Job aborted due to stage failure: Total size of serialized results of 108 tasks (1027.9 MB) is bigger than spark.driver.maxResultSize (1024.0 MB)
看来我需要更新 spark 配置中的 maxResultsSize。如何从 jupyter notebook 设置 spark maxResultsSize。
已查看此帖子:Spark 1.4 increase maxResultSize memory
另外,在emr notebook中,spark context已经给出了,有什么办法可以编辑spark context,增加maxResultsSize
任何线索都会非常有帮助。
谢谢
最佳答案
您可以在 spark session 开始时设置 livy 配置 见 https://github.com/cloudera/livy#request-body
将其放在代码的开头
%%configure -f
{"conf":{"spark.driver.maxResultSize":"15G"}}
通过在下一个单元格中打印 session 来检查设置:
print(spark.conf.get('spark.driver.maxResultSize'))
这应该可以解决问题
关于apache-spark - 在 EMR 笔记本 jupyter 中设置 spark.driver.maxResultSize,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61728152/