【发布时间】:2016-04-28 15:06:00
【问题描述】:
例如,我有一个文件夹:
/
- test.py
- test.yml
作业被提交到火花集群:
gcloud beta dataproc jobs submit pyspark --files=test.yml "test.py"
在test.py,我想访问我上传的静态文件。
with open('test.yml') as test_file:
logging.info(test_file.read())
但出现以下异常:
IOError: [Errno 2] No such file or directory: 'test.yml'
如何访问我上传的文件?
【问题讨论】:
-
我想到的第一件事就是将文件添加到集群可以访问的分布式文件系统(如 HDFS)中。我相信其他人会提供更好的解决方案。
标签: python apache-spark pyspark google-cloud-dataproc