How to overwrite the existing files using hadoop fs -copyToLocal command

前端 未结 8 1162
小蘑菇
小蘑菇 2021-02-01 13:08

Is there any way we can overwrite existing files, while coping from HDFS using:

hadoop fs -copyToLocal  
         


        
相关标签:
8条回答
  • 2021-02-01 13:36

    You could try this :

    bin/hadoop fs -rm /path_of_the_file | grep "0" | bin/hadoop fs -put ~/input_path /output_path
    
    0 讨论(0)
  • 2021-02-01 13:38

    You can first delete, then write.

    hadoop fs -rmr <path> removes everything under given path in hdfs including the path itself

    rm -rf <path> removes in local file system.

    Make sure that there is no other file in the directory.

    0 讨论(0)
提交回复
热议问题