abstractdog commented on code in PR #4753:
URL: https://github.com/apache/hive/pull/4753#discussion_r1341914772
##########
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);
Review Comment:
good catch, we can return early in that case
--
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]