Difference between hadoop fs -put and hadoop fs -copyFromLocal

前端 未结 5 365
一个人的身影
一个人的身影 2020-12-02 15:26

-put and -copyFromLocal are documented as identical, while most examples use the verbose variant -copyFromLocal. Why?

Same thing for

5条回答
  •  春和景丽
    2020-12-02 16:10

    Let's make an example: If your HDFS contains the path: /tmp/dir/abc.txt And if your local disk also contains this path then the hdfs API won't know which one you mean, unless you specify a scheme like file:// or hdfs://. Maybe it picks the path you did not want to copy.

    Therefore you have -copyFromLocal which is preventing you from accidentally copying the wrong file, by limiting the parameter you give to the local filesystem.

    Put is for more advanced users who know which scheme to put in front.

    It is always a bit confusing to new Hadoop users which filesystem they are currently in and where their files actually are.

提交回复
热议问题