Untitled

mail@pastecode.io avatar
unknown
python
a year ago
279 B
4
Indexable
Never
from django.core.files import File
from django_hadoop_storage import HadoopStorage

hadoop_storage = HadoopStorage()
file = File(open('local_file.txt', 'rb'))
hadoop_storage.save('hdfs_file.txt', file)

hdfs_file = hadoop_storage.open('hdfs_file.txt')
hdfs_file.close()