As per my knowledge, there is no straight option to overwrite the file in HDFS while doing a move from one HDFS location to other, copying cp has the option to force. I'm trying to find if there is any hack to do that?
what we can do is hdfs dfs -cp -f /hdfs/location1 /hdfs/location2 but not hdfs dfs -mv -f /hdfs/location1/ /hdfs/location2/
One way to achieve my purpose is to do the hdfs dfs -cp -f /hdfs/location1 /hdfs/location2 first and then get rid of the location1 file with hdfs dfs -rm -r /hdfs/location1 but I don't want to do that for some reason. Any other approach with one single command will be appriciated.
thanks in advance !!