abstractdog commented on code in PR #4753:
URL: https://github.com/apache/hive/pull/4753#discussion_r1341914799


##########
common/src/java/org/apache/hadoop/hive/common/FileUtils.java:
##########
@@ -1387,6 +1388,47 @@ public static RemoteIterator<LocatedFileStatus> 
listFiles(FileSystem fs, Path pa
         status -> filter.accept(status.getPath()));
   }
 
+  /**
+   * Resolves a symlink on a local filesystem. In case of any exceptions or 
scheme other than "file"
+   * it simply returns the original path. Refer to DEBUG level logs for 
further details.
+   * @param path
+   * @param conf
+   * @return
+   * @throws IOException
+   */
+  public static Path resolveSymlinks(Path path, Configuration conf) throws 
IOException {
+    if (path == null) {
+      return null;
+    }
+
+    FileSystem srcFs;
+    String scheme = path.toUri().getScheme();
+    if (scheme != null) {
+      srcFs = path.getFileSystem(conf);
+    } else {
+      srcFs = FileSystem.getLocal(conf);
+    }
+    LOG.debug("resolveSymlink path: {}, srcFs class: {}, scheme: {}", path, 
srcFs.getClass().getName(), scheme);
+
+    /**

Review Comment:
   normal is fine



##########
common/src/java/org/apache/hadoop/hive/common/FileUtils.java:
##########
@@ -1387,6 +1388,47 @@ public static RemoteIterator<LocatedFileStatus> 
listFiles(FileSystem fs, Path pa
         status -> filter.accept(status.getPath()));
   }
 
+  /**
+   * Resolves a symlink on a local filesystem. In case of any exceptions or 
scheme other than "file"
+   * it simply returns the original path. Refer to DEBUG level logs for 
further details.
+   * @param path
+   * @param conf
+   * @return
+   * @throws IOException

Review Comment:
   will do



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