首页 > 解决方案 > Python - 如何从 HDFS 读取 xml?

问题描述


我正在使用 PySpark,我想使用xml.etreelibrairie 从 HDFS 读取 xml。
这是我的代码:

from xml.etree import ElementTree
dom = ElementTree.parse('hdfs://hadoop-master:9000/response.xml')

但我得到这个错误:

IOError: [Errno 2] No such file or directory: 'hdfs://hadoop-master:9000/response.xml'

有没有办法解决这个问题?
谢谢

标签: pythonxmlhdfs

解决方案


推荐阅读