ayushtkn commented on code in PR #3231:
URL: https://github.com/apache/hive/pull/3231#discussion_r864755215


##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/info/show/status/formatter/ShowTableStatusFormatter.java:
##########
@@ -123,13 +123,17 @@ FileData getFileData(HiveConf conf, List<Path> locations, 
Path tablePath) throws
     if (!fileData.unknown) {
       for (Path location : locations) {
         try {
-          FileStatus status = fileSystem.getFileStatus(location);
+          // Use right FileSystem object for partition in customized location
+          FileSystem locationFileSystem = 
location.toString().startsWith(tablePath.toString()) ? fileSystem
+              : location.getFileSystem(conf);

Review Comment:
   if the partition location is hdfs://ns1/tmp/hivePart and the table location 
is hdfs://ns1/hive/table
   In this case the FileSystem is same, still you will land up doing this 
getFileSystem()? We could have matched the scheme & authority of the path only?
   
   Secondly, if we want to do this only, can we use 
`FileUtils.isPathWithinSubtree(location, tablePath)`



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