hdfs dfs -put with overwrite?

ℕʘʘḆḽḘ picture ℕʘʘḆḽḘ · Apr 23, 2016 · Viewed 49.8k times · Source

I am using

hdfs dfs -put myfile mypath

and for some files I get

put: 'myfile': File Exists
  • does that mean there is a file with the same name or does that mean the same exact file (size, content) is already there?
  • how can I specify an -overwrite option here?

Thanks!

Answer

Sumit picture Sumit · Apr 23, 2016

put: 'myfile': File Exists

Means,the file named "myfile" already exists in hdfs. You cannot have multiple files of the same name in hdfs

You can overwrite it using hadoop fs -put -f /path_to_local /path_to_hdfs