Skip to content

Commit

Permalink
add getDatabaseLocation method by HiveCatalog
Browse files Browse the repository at this point in the history
  • Loading branch information
pongandnoon committed Feb 26, 2024
1 parent 52d0cdf commit 524dc0a
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,20 @@ public Path getDataTableLocation(Identifier identifier) {
throw new RuntimeException("Can not get table " + identifier + " from metastore.", e);
}
}
public Path getDatabaseLocation(String databaseName){
try {
if (databaseExistsImpl(databaseName)) {
String location =
locationHelper.getDatabaseLocation(client.getDatabase(databaseName));
if (location != null) {
return new Path(location);
}
}
} catch (TException e) {
throw new RuntimeException("Can not get database " + databaseName + " from metastore.", e);
}
return null;
}

@Override
public List<String> listDatabases() {
Expand Down

0 comments on commit 524dc0a

Please sign in to comment.