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/05/04 12:09:15 UTC

[GitHub] [hive] ayushtkn commented on a diff in pull request #3231: HIVE-22013: SHOW TABLE EXTENDED query fails with Wrong FS error for partition in customized location

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