aasha commented on a change in pull request #987:
URL: https://github.com/apache/hive/pull/987#discussion_r411930184



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/repl/CopyUtils.java
##########
@@ -383,10 +385,17 @@ private void doRegularCopyOnce(FileSystem sourceFs, 
List<Path> srcList,
         throw new IOException(e);
       }
     } else {
+      deleteSubDirs(destinationFs, destination);
       FileUtil.copy(sourceFs, paths, destinationFs, destination, false, true, 
hiveConf);
     }
   }
 
+  private void deleteSubDirs(FileSystem destinationFs, Path destination) 
throws IOException {
+    for (FileStatus status : destinationFs.listStatus(destination)) {

Review comment:
       We need the destination folder to be present. Thats an extra FS call if 
we delete first and recreate again.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to