[英]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.