spring distcp creates target folder as filename

364 Views Asked by At

I am using spring DistCp to copy a file within hdfs. My code looks like this

distcp.copy(null, null, null, "/tmp",  null, null, null, null, null, null, null, 
        new String[]{"/user/aq728y/publish/test.txt", "/user/aq728y/publish2/test.txt"});

In this case e.g. I want to copy the test.txt file from publish folder to publish2 folder. Whether publish2 folder exists or not, what ends up happening is that distcp creates a folder called publish2/test.txt and then inside that folder it copies the test.txt file. So its ends up being publish2/test.txt/test.txt

If I use hadoop distcp directly I dont see this issue. Any idea why this is happening.

0

There are 0 best solutions below