繁体   English   中英

如何使用python处理hdfs中的文件

[英]How to process the files in hdfs using python

有人可以告诉我如何在python程序中打开和处理hdfs中的文件吗?

谢谢

您可以使用以下之一:

https://code.google.com/p/libpyhdfs/

https://github.com/traviscrawford/python-hdfs

或者只是在没有外部库的情况下做类似的事情:

file = subprocess.Popen(["hadoop", "fs", "-cat", "/path/to/file"], stdout=subprocess.PIPE)
for line in file.stdout:
    print line

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM