public class DatabaseName extends Object
Constructor and Description |
---|
DatabaseName(String cat,
String db) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
static DatabaseName |
fromString(String name,
String defaultCatalog)
Build a DatabaseName from a string of the form [catalog.]database.
|
String |
getCat() |
String |
getDb() |
static String |
getQualified(String catName,
String dbName) |
int |
hashCode() |
String |
toString() |
public DatabaseName(String cat, String db)
cat
- catalog name. This cannot be null. If you don't know the value, then likely the
right answer is to fetch it from SessionState.getCurrentCatalog() if you want to
get the catalog being used in the current session or
MetaStoreUtils.getDefaultCatalog() if you want to get the default catalog for
this Hive instance.db
- database name. This cannot be null.public static DatabaseName fromString(String name, String defaultCatalog)
name
- name, can be "db" or "cat.db"defaultCatalog
- default catalog to use if catalog name is not in the name. This can
be null if you are absolutely certain that the catalog name is
embedded in name. If you want the default catalog to be determined by
the session, use SessionState.getCurrentCatalog(). If you want it to
be determined by the default for the Hive instance or you are not in a
session, use MetaStoreUtils.getDefaultCatalog().public String getCat()
public String getDb()
Copyright © 2021 The Apache Software Foundation. All rights reserved.