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