Put file on HDFS with spaces in name

前端 未结 5 454
旧巷少年郎
旧巷少年郎 2021-01-15 05:23

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

5条回答
  •  执笔经年
    2021-01-15 05:45

    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.

提交回复
热议问题