-
-
Save hyunjun/8f2080557e7b7b261861a260d9225bb4 to your computer and use it in GitHub Desktop.
pywebhdfs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pywebhdfs.webhdfs import PyWebHdfsClient | |
client = PyWebHdfsClient(host='namenode-1.server.ip.address', port=14000, user_name='<user name>') | |
r = client.read_file(<file name>) | |
for l in r.decode('utf-8').split('\n'): | |
l = l.strip() | |
if 0 == len(l): | |
continue | |
# work | |
client.create_file(<file name>, '\n'.join([line for line in lines]).encode('utf-8')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment