Support Questions
Find answers, ask questions, and share your expertise

distcp behavior depends on target hierarchy existence

New Contributor

Hi, I noticed mixed behavior when using distcp on my env (hortonbox sandbox) depends on the target directory existence

with source with the following;

hdfs://nn:1111/foo/bar -


and when executing:

Hadoop distcp hdfs://nn:1111/foo/bar hdfs://nn2:8888/dstdir

if "dstdir" on the target doesn't exist, it'll be created and the *contents* of the source will be copied to it directly so eventually it will contain a.txt

alternatively, if dstdir does exist - the "bar" directory will be copied to it so a.txt will be under hdfs://nn2:8888/dstdir/bar/a.txt

it this behavior somewhere documented\expected?