You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2022/01/27 06:38:46 UTC

[GitHub] [hive] pvary commented on a change in pull request #2921: HIVE-21100: Allow flattening of union subdirectories

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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org