public class TableName extends Object implements Serializable
| Constructor and Description |
|---|
TableName(String catName,
String dbName,
String tableName) |
TableName(String catName,
String dbName,
String tableName,
String metaTable) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
static TableName |
fromString(String name,
String defaultCatalog,
String defaultDatabase) |
static TableName |
fromString(String name,
String defaultCatalog,
String defaultDatabase,
String metaTable)
Build a TableName from a string of the form [[catalog.]database.]table.
|
String |
getCat() |
String |
getDb() |
String |
getDbTable()
Deprecated.
use
getNotEmptyDbTable() instead. |
static String |
getDbTable(String dbName,
String tableName)
Get the name in db.table format, for use with stuff not yet converted to use the catalog.
|
String |
getEscapedNotEmptyDbTable()
Get the name in `db`.`table` escaped format, if db is not empty, otherwise pass only the table name.
|
String |
getMetaTable() |
String |
getNotEmptyDbTable()
Get the name in db.table format, if db is not empty, otherwise pass only the table name.
|
static String |
getQualified(String catName,
String dbName,
String tableName) |
String |
getTable() |
int |
hashCode() |
String |
toString() |
public TableName(String catName, String dbName, String tableName, String metaTable)
catName - catalog name. Cannot be null. If you do not know it you can get it from
SessionState.getCurrentCatalog() if you want to use the catalog from the current
session, or from MetaStoreUtils.getDefaultCatalog() if you do not have a session
or want to use the default catalog for the Hive instance.dbName - database name. Cannot be null. If you do not now it you can get it from
SessionState.getCurrentDatabase() or use Warehouse.DEFAULT_DATABASE_NAME.tableName - table name, cannot be nullmetaTable - name
Use this to query Iceberg metadata tables.public static TableName fromString(String name, String defaultCatalog, String defaultDatabase)
public static TableName fromString(String name, String defaultCatalog, String defaultDatabase, String metaTable) throws IllegalArgumentException
name - name in string form, not nulldefaultCatalog - default catalog to use if catalog is not in the name. If you do not
know it you can get it from SessionState.getCurrentCatalog() if you
want to use the catalog from the current session, or from
MetaStoreUtils.getDefaultCatalog() if you do not have a session or
want to use the default catalog for the Hive instance.defaultDatabase - default database to use if database is not in the name. If you do
not now it you can get it from SessionState.getCurrentDatabase() or
use Warehouse.DEFAULT_DATABASE_NAME.metaTable - When querying Iceberg metadata tables, set this parameter.IllegalArgumentException - if a non-null name is givenpublic String getCat()
public String getDb()
public String getTable()
public String getMetaTable()
public String getDbTable()
getNotEmptyDbTable() instead.public String getEscapedNotEmptyDbTable()
public String getNotEmptyDbTable()
public static String getDbTable(String dbName, String tableName)
Copyright © 2022 The Apache Software Foundation. All rights reserved.