Skip to content
Advertisement

copy file with spaces in to hdfs

I have a file with name DT2516%_date_cdfs 05-feb-2017.csv .I need to copy it into hdfs . I am using the following command.

Hadoop fs -put DT2516%_date_cdfs 05-feb-2017.csv /tmp/

Error: put : Unexpected URISyntaxException

How do I copy such files?

Advertisement

Answer

Here is what you can do

cat DT2516%_date_cdfs 05-feb-2017.csv | hdfs dfs -put - '/tmp/DT2516%_date_cdfs 05-feb-2017.csv'

enter image description here

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement