[ 
https://issues.apache.org/jira/browse/HIVE-22013?focusedWorklogId=770593&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-770593
 ]

ASF GitHub Bot logged work on HIVE-22013:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 15/May/22 16:42
            Start Date: 15/May/22 16:42
    Worklog Time Spent: 10m 
      Work Description: ganeshashree commented on code in PR #3231:
URL: https://github.com/apache/hive/pull/3231#discussion_r873194842


##########
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:
   @ayushtkn Thanks for reviewing. It makes sense to match scheme and 
authority. Please review the updated PR.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 770593)
    Time Spent: 40m  (was: 0.5h)

> "Show table extended" query fails with Wrong FS error for partition in 
> customized location
> ------------------------------------------------------------------------------------------
>
>                 Key: HIVE-22013
>                 URL: https://issues.apache.org/jira/browse/HIVE-22013
>             Project: Hive
>          Issue Type: Bug
>          Components: Hive
>            Reporter: Rajesh Balamohan
>            Assignee: Ganesha Shreedhara
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> In some of the `show table extended` statements, following codepath is invoked
> [https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/metadata/formatting/TextMetaDataFormatter.java#L421]
> [https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/metadata/formatting/TextMetaDataFormatter.java#L449]
> [https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/metadata/formatting/TextMetaDataFormatter.java#L468]
> 1. Not sure why this invokes stats computation. This should be removed?
>  2. Even if #1 is needed, it would be broken when {{tblPath}} and 
> {{partitionPaths}} are different (i.e when both of them of them are in 
> different fs or configured via router etc).
> {noformat}
> Caused by: java.lang.IllegalArgumentException: Wrong FS: 
> hdfs://xyz/blah/tables/location/, expected: hdfs://zzz..
>       at org.apache.hadoop.fs.FileSystem.checkPath(FileSystem.java:657)
>       at 
> org.apache.hadoop.hdfs.DistributedFileSystem.getPathName(DistributedFileSystem.java:194)
>       at 
> org.apache.hadoop.hdfs.DistributedFileSystem.listStatusInternal(DistributedFileSystem.java:698)
>       at 
> org.apache.hadoop.hdfs.DistributedFileSystem.access$600(DistributedFileSystem.java:106)
>       at 
> org.apache.hadoop.hdfs.DistributedFileSystem$15.doCall(DistributedFileSystem.java:763)
>       at 
> org.apache.hadoop.hdfs.DistributedFileSystem$15.doCall(DistributedFileSystem.java:759)
>       at 
> org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)
>       at 
> org.apache.hadoop.hdfs.DistributedFileSystem.listStatus(DistributedFileSystem.java:759)
>       at 
> org.apache.hadoop.hive.ql.metadata.formatting.TextMetaDataFormatter.writeFileSystemStats(TextMetaDataFormatter.java
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to