pvary commented on a change in pull request #2921:
URL: https://github.com/apache/hive/pull/2921#discussion_r793291201



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java
##########
@@ -97,6 +101,40 @@ public MoveTask() {
     super();
   }
 
+  public void flattenUnionSubdirectories(Path sourcePath) throws HiveException 
{
+    try {
+      FileSystem fs = sourcePath.getFileSystem(conf);
+      LOG.info("Checking " + sourcePath + " for subdirectories to flatten");
+      Set<Path> unionSubdirs = new HashSet<>();
+      if (fs.exists(sourcePath)) {

Review comment:
       This is a costly call. We have a same result with catching the relevant 
exception in `listFiles`, and we can save one FileSystem.exists call. 




-- 
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.

To unsubscribe, e-mail: [email protected]

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