1. 程式人生 > >python連接hdfs

python連接hdfs

dfs with local python bsp import hdf rom hdfs

from hdfs.client import Client

client = Client("http://localhost:50070")

print client.list(‘/‘)

hdfs_dir = ‘/data/hive/warehouse‘

with client.read(hdfs_dir) as f:

print f.read()

python連接hdfs