# -*- coding:utf-8 -*- from hdfs.client import Client client = Client("http://localhost:50070") filepath="/data/input/test.txt" with client.read(filepath) as fs: content = fs.read() print(content)
提示:mac pycharm python2.7环境,亲测无误!
# -*- coding:utf-8 -*- from hdfs.client import Client client = Client("http://localhost:50070") filepath="/data/input/test.txt" with client.read(filepath) as fs: content = fs.read() print(content)
提示:mac pycharm python2.7环境,亲测无误!
转载于:https://www.cnblogs.com/RHadoop-Hive/p/9396169.html