Python Notes41:读取HDFS

Python Notes41:读取HDFS

Python库

  • hdfs库
  • snakebite库
  • pyhdfs库
  • libhdfs库
  • pyarrow库

DHFS使用

from hdfs.client import Client # 50070: NameNode web管理端口 client = Client("http://192.168.92.145:9870/") # c = client.list("/") #列出所有hdfs目录 # print(c) FILENAME = "/input/LX_SEGY005.segy" #hdfs文件路径 with client.read(FILENAME) as fs: content = fs.read() print(content)