Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
621 views
in Technique[技术] by (71.8m points)

hadoop - hdfs dfs -put with overwrite?

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!

question from:https://stackoverflow.com/questions/36816526/hdfs-dfs-put-with-overwrite

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...