Repository: hive Updated Branches: refs/heads/master c399c4ed1 -> 916ef9235
HIVE-20471 : issues getting the default database path (Sergey Shelukhin, reviewed by Ashutosh Chauhan) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/916ef923 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/916ef923 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/916ef923 Branch: refs/heads/master Commit: 916ef9235971fe6a0c47b386702d42035d5f7e8a Parents: c399c4e Author: sergey <ser...@apache.org> Authored: Tue Sep 11 12:10:04 2018 -0700 Committer: sergey <ser...@apache.org> Committed: Tue Sep 11 12:13:01 2018 -0700 ---------------------------------------------------------------------- .../main/java/org/apache/hadoop/hive/metastore/Warehouse.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/916ef923/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/Warehouse.java ---------------------------------------------------------------------- diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/Warehouse.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/Warehouse.java index da5a71c..294dfb7 100755 --- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/Warehouse.java +++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/Warehouse.java @@ -140,8 +140,11 @@ public class Warehouse { */ 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 {