public class TableName extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
static Pattern |
SNAPSHOT_REF |
| Constructor and Description |
|---|
TableName(String catName,
String dbName,
String tableName) |
TableName(String catName,
String dbName,
String tableName,
String tableMetaRef) |
| 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 tableMetaRef)
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 |
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() |
String |
getTableMetaRef() |
int |
hashCode() |
String |
toString() |
public static final Pattern SNAPSHOT_REF
public TableName(String catName, String dbName, String tableName, String tableMetaRef)
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 nulltableMetaRef - name
Use this to query table meta ref, e.g. iceberg metadata table or branchpublic static TableName fromString(String name, String defaultCatalog, String defaultDatabase)
public static TableName fromString(String name, String defaultCatalog, String defaultDatabase, String tableMetaRef) 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.tableMetaRef - When querying Iceberg meta ref, e.g. metadata table or branch, set this parameter.IllegalArgumentException - if a non-null name is givenpublic String getCat()
public String getDb()
public String getTable()
public String getTableMetaRef()
public String getDbTable()
getNotEmptyDbTable() instead.public String getEscapedNotEmptyDbTable()
public String getNotEmptyDbTable()
public static String getDbTable(String dbName, String tableName)
Copyright © 2024 The Apache Software Foundation. All rights reserved.