diff --git standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/Warehouse.java standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/Warehouse.java index da5a71cc64..294dfb728e 100755 --- standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/Warehouse.java +++ standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/Warehouse.java @@ -140,8 +140,11 @@ public FileSystem getFs(Path f) throws MetaException { */ public static Path getDnsPath(Path path, Configuration conf) throws MetaException { FileSystem fs = getFs(path, conf); - return (new Path(fs.getUri().getScheme(), fs.getUri().getAuthority(), path - .toUri().getPath())); + String uriPath = path.toUri().getPath(); + if (StringUtils.isEmpty(uriPath)) { + uriPath = "/"; + } + return (new Path(fs.getUri().getScheme(), fs.getUri().getAuthority(), uriPath)); } public Path getDnsPath(Path path) throws MetaException {