zhangbutao commented on code in PR #5504:
URL: https://github.com/apache/hive/pull/5504#discussion_r1950183222


##########
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/Warehouse.java:
##########
@@ -151,40 +145,24 @@ public FileSystem getFs(Path f) throws MetaException {
    * @return Path with canonical scheme and authority
    */
   public static Path getDnsPath(Path path, Configuration conf) throws 
MetaException {
-    if (isBlobStorageScheme(conf, path.toUri().getScheme())) {
-      String scheme = path.toUri().getScheme();
-      String authority = path.toUri().getAuthority();
-      URI defaultUri = FileSystem.getDefaultUri(conf);
-      if ((authority == null && scheme == null)
-              || StringUtils.equalsIgnoreCase(scheme, defaultUri.getScheme())) 
{
-        if (authority == null) {
-          authority = defaultUri.getAuthority();
-        }
-        if (scheme == null) {
-          scheme = defaultUri.getScheme();
-        }
-        String uriPath = path.toUri().getPath();
-        if (StringUtils.isEmpty(uriPath)) {
-          uriPath = "/";
-        }
-        return new Path(scheme, authority, uriPath);
+    String scheme = path.toUri().getScheme();
+    String authority = path.toUri().getAuthority();
+    URI defaultUri = FileSystem.getDefaultUri(conf);
+    if ((authority == null && scheme == null)
+        || StringUtils.equalsIgnoreCase(scheme, defaultUri.getScheme())) {
+      if (authority == null) {
+        authority = defaultUri.getAuthority();
+      }
+      if (scheme == null) {
+        scheme = defaultUri.getScheme();
       }
-      return path;
-    } else { // fallback: for other FS type make the FS instance
-      FileSystem fs = getFs(path, conf);

Review Comment:
   `FileSystem fs = getFs(path, conf);`  This PR is just want to remove this 
code for all schemas(s3, hdfs), so this can reduce some filesystem rpc call.



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