I have a file named file name(1).zip
(with the space and parentheses in it) and I want to put this file on the HDFS. But everytime I try to put it via had
HDFS is totally fine with spaces in the file or directory names.
It is the hdfs
that does not support putting a file from local disk with spaces in its file name. But there is a trick to achieve this ( reference ):
cat file\ name\(1\).zip | hadoop fs -put - "/tmp/one/file name(1).zip"
Hope this helps those that need this.
try
fs -put 'file name(1).zip' tmp/one
The most obvious workaround is to rename the file before storing it on HDFS, don't you think?
hadoop fs -get /landing/novdata/'2017-01-05 - abc def 5H.csv'
See the single quotes around the filename
Replace the spaces with %20.
The percent-encoding for space is %20
Use
hadoop fs -put first%20name.zip /tmp/one
instead of
hadoop fs -put first name.zip /tmp/one