我使用 pip
安装了 pyspark
。
我在 jupyter
笔记本中编写代码。一切正常,但导出大型 .csv
文件时出现 java
堆空间错误。
Here有人建议编辑 spark-defaults.config
。同样在 Spark 文档中,它说
"Note: In client mode, this config must not be set through the SparkConf directly in your application, because the driver JVM has already started at that point. Instead, please set this through the --driver-memory command line option or in your default properties file."
但是用pip
安装pyspark
时恐怕没有这个文件。
我是我没错吧?我该如何解决这个问题?
谢谢!
最佳答案
我最近也遇到了这个问题。如果您查看 Classpath Entries 下的 Spark UI,第一个路径可能是配置目录,例如 /.../lib/python3.7/site-packages/pyspark/conf/
.当我查找该目录时,它不存在;据推测它不是 pip 安装的一部分。但是,您可以轻松创建它并添加您自己的配置文件。例如,
mkdir /.../lib/python3.7/site-packages/pyspark/conf
vi /.../lib/python3.7/site-packages/pyspark/conf/spark-defaults.conf
关于pyspark - 用 pip install pyspark 安装时是否有spark-defaults.conf,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57025924/