public class RESTCatalog extends Object implements Catalog
Catalog.BranchAlreadyExistException, Catalog.BranchNotExistException, Catalog.ColumnAlreadyExistException, Catalog.ColumnNotExistException, Catalog.DatabaseAlreadyExistException, Catalog.DatabaseNoPermissionException, Catalog.DatabaseNotEmptyException, Catalog.DatabaseNotExistException, Catalog.DefinitionAlreadyExistException, Catalog.DefinitionNotExistException, Catalog.DialectAlreadyExistException, Catalog.DialectNotExistException, Catalog.FunctionAlreadyExistException, Catalog.FunctionNotExistException, Catalog.ProcessSystemDatabaseException, Catalog.TableAlreadyExistException, Catalog.TableNoPermissionException, Catalog.TableNotExistException, Catalog.TagNotExistException, Catalog.ViewAlreadyExistException, Catalog.ViewNotExistExceptionCOMMENT_PROP, DB_LOCATION_PROP, DB_SUFFIX, DEFAULT_DATABASE, LAST_UPDATE_TIME_PROP, NUM_FILES_PROP, NUM_ROWS_PROP, OWNER_PROP, SYSTEM_DATABASE_NAME, TABLE_DEFAULT_OPTION_PREFIX, TOTAL_SIZE_PROP| Constructor and Description |
|---|
RESTCatalog(CatalogContext context) |
RESTCatalog(CatalogContext context,
boolean configRequired) |
| Modifier and Type | Method and Description |
|---|---|
void |
alterDatabase(String name,
List<PropertyChange> changes,
boolean ignoreIfNotExists)
Alter a database.
|
void |
alterFunction(Identifier identifier,
List<FunctionChange> changes,
boolean ignoreIfNotExists)
Alter function.
|
void |
alterPartitions(Identifier identifier,
List<PartitionStatistics> partitions)
Alter partitions of the specify table.
|
void |
alterTable(Identifier identifier,
List<SchemaChange> changes,
boolean ignoreIfNotExists)
Modify an existing table from
SchemaChanges. |
void |
alterView(Identifier identifier,
List<ViewChange> viewChanges,
boolean ignoreIfNotExists)
Alter a view.
|
List<String> |
authTableQuery(Identifier identifier,
List<String> select)
Auth table query select and get the filter for row level access control.
|
boolean |
caseSensitive()
Return a boolean that indicates whether this catalog is case-sensitive.
|
RESTCatalogLoader |
catalogLoader()
Serializable loader to create catalog.
|
void |
close() |
boolean |
commitSnapshot(Identifier identifier,
String tableUuid,
Snapshot snapshot,
List<PartitionStatistics> statistics)
Commit the
Snapshot for table identified by the given Identifier. |
void |
createBranch(Identifier identifier,
String branch,
String fromTag)
Create a new branch for this table.
|
void |
createDatabase(String name,
boolean ignoreIfExists,
Map<String,String> properties)
Create a database with properties.
|
void |
createFunction(Identifier identifier,
Function function,
boolean ignoreIfExists)
Create a new function.
|
void |
createPartitions(Identifier identifier,
List<Map<String,String>> partitions)
Create partitions of the specify table.
|
void |
createTable(Identifier identifier,
Schema schema,
boolean ignoreIfExists)
Create a new table.
|
void |
createView(Identifier identifier,
View view,
boolean ignoreIfExists)
Create a new view.
|
void |
dropBranch(Identifier identifier,
String branch)
Drop the branch for this table.
|
void |
dropDatabase(String name,
boolean ignoreIfNotExists,
boolean cascade)
Drop a database.
|
void |
dropFunction(Identifier identifier,
boolean ignoreIfNotExists)
Drop function.
|
void |
dropPartitions(Identifier identifier,
List<Map<String,String>> partitions)
Drop partitions of the specify table.
|
void |
dropTable(Identifier identifier,
boolean ignoreIfNotExists)
Drop a table.
|
void |
dropView(Identifier identifier,
boolean ignoreIfNotExists)
Drop a view.
|
void |
fastForward(Identifier identifier,
String branch)
Fast-forward a branch to main branch.
|
Database |
getDatabase(String name)
Return a
Database identified by the given name. |
Function |
getFunction(Identifier identifier)
Get function by name.
|
Table |
getTable(Identifier identifier)
Return a
Table identified by the given Identifier. |
View |
getView(Identifier identifier)
Return a
View identified by the given Identifier. |
List<String> |
listBranches(Identifier identifier)
List all branches of the table.
|
List<String> |
listDatabases()
Get the names of all databases in this catalog.
|
PagedList<String> |
listDatabasesPaged(Integer maxResults,
String pageToken,
String databaseNamePattern)
Get paged list names of all databases in this catalog.
|
List<String> |
listFunctions(String databaseName)
Get the names of all functions in this catalog.
|
List<Partition> |
listPartitions(Identifier identifier)
Get Partition of all partitions of the table.
|
PagedList<Partition> |
listPartitionsPaged(Identifier identifier,
Integer maxResults,
String pageToken,
String partitionNamePattern)
Get paged partition list of the table, the partition list will be returned in descending
order.
|
PagedList<Snapshot> |
listSnapshotsPaged(Identifier identifier,
Integer maxResults,
String pageToken)
Get paged snapshot list of the table, the snapshot list will be returned in descending order.
|
PagedList<Table> |
listTableDetailsPaged(String db,
Integer maxResults,
String pageToken,
String tableNamePattern)
Get paged list of table details under this database.
|
List<String> |
listTables(String databaseName)
Get names of all tables under this database.
|
PagedList<String> |
listTablesPaged(String databaseName,
Integer maxResults,
String pageToken,
String tableNamePattern)
Get paged list names of tables under this database.
|
PagedList<String> |
listTablesPagedGlobally(String databaseNamePattern,
String tableNamePattern,
Integer maxResults,
String pageToken)
Gets an array of tables for a catalog.
|
PagedList<View> |
listViewDetailsPaged(String db,
Integer maxResults,
String pageToken,
String viewNamePattern)
Get paged list view details under this database.
|
List<String> |
listViews(String databaseName)
Get names of all views under this database.
|
PagedList<String> |
listViewsPaged(String databaseName,
Integer maxResults,
String pageToken,
String viewNamePattern)
Get paged list names of views under this database.
|
PagedList<String> |
listViewsPagedGlobally(String databaseNamePattern,
String viewNamePattern,
Integer maxResults,
String pageToken)
Gets an array of views for a catalog.
|
Optional<TableSnapshot> |
loadSnapshot(Identifier identifier)
Return the snapshot of table identified by the given
Identifier. |
Optional<Snapshot> |
loadSnapshot(Identifier identifier,
String version)
Return the snapshot of table for given version.
|
protected GetTableTokenResponse |
loadTableToken(Identifier identifier) |
void |
markDonePartitions(Identifier identifier,
List<Map<String,String>> partitions)
Mark partitions done of the specify table.
|
Map<String,String> |
options()
Catalog options for re-creating this catalog.
|
void |
renameTable(Identifier fromTable,
Identifier toTable,
boolean ignoreIfNotExists)
Rename a table.
|
void |
renameView(Identifier fromView,
Identifier toView,
boolean ignoreIfNotExists)
Rename a view.
|
void |
rollbackTo(Identifier identifier,
Instant instant)
rollback table by the given
Identifier and instant. |
boolean |
supportsListByPattern()
Whether this catalog supports name pattern filter when list objects paged.
|
boolean |
supportsListObjectsPaged()
Whether this catalog supports list objects paged.
|
boolean |
supportsVersionManagement()
Whether this catalog supports version management for tables.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitalterTable, createDatabase, invalidateTable, repairCatalog, repairDatabase, repairTablepublic RESTCatalog(CatalogContext context)
public RESTCatalog(CatalogContext context, boolean configRequired)
public Map<String,String> options()
Catalogpublic RESTCatalogLoader catalogLoader()
CatalogcatalogLoader in interface Catalogpublic List<String> listDatabases()
CataloglistDatabases in interface Catalogpublic PagedList<String> listDatabasesPaged(@Nullable Integer maxResults, @Nullable String pageToken, @Nullable String databaseNamePattern)
CataloglistDatabasesPaged in interface CatalogmaxResults - Optional parameter indicating the maximum number of results to include in
the result. If maxResults is not specified or set to 0, will return the default number of
max results.pageToken - Optional parameter indicating the next page token allows list to be start
from a specific point.databaseNamePattern - A sql LIKE pattern (%) for database names. All databases will be
returned * if not set or empty. Currently, only prefix matching is supported.Catalog.supportsListObjectsPaged().public void createDatabase(String name, boolean ignoreIfExists, Map<String,String> properties) throws Catalog.DatabaseAlreadyExistException
CatalogcreateDatabase in interface Catalogname - Name of the database to be createdignoreIfExists - Flag to specify behavior when a database with the given name already
exists: if set to false, throw a DatabaseAlreadyExistException, if set to true, do
nothing.properties - properties to be associated with the databaseCatalog.DatabaseAlreadyExistException - if the given database already exists and ignoreIfExists
is falsepublic Database getDatabase(String name) throws Catalog.DatabaseNotExistException
CatalogDatabase identified by the given name.getDatabase in interface Catalogname - Database nameDatabaseCatalog.DatabaseNotExistException - if the requested database does not existpublic void dropDatabase(String name, boolean ignoreIfNotExists, boolean cascade) throws Catalog.DatabaseNotExistException, Catalog.DatabaseNotEmptyException
CatalogdropDatabase in interface Catalogname - Name of the database to be dropped.ignoreIfNotExists - Flag to specify behavior when the database does not exist: if set to
false, throw an exception, if set to true, do nothing.cascade - Flag to specify behavior when the database contains table or function: if set
to true, delete all tables and functions in the database and then delete the database, if
set to false, throw an exception.Catalog.DatabaseNotEmptyException - if the given database is not empty and isRestrict is trueCatalog.DatabaseNotExistExceptionpublic void alterDatabase(String name, List<PropertyChange> changes, boolean ignoreIfNotExists) throws Catalog.DatabaseNotExistException
CatalogalterDatabase in interface Catalogname - Name of the database to alter.changes - the property changesignoreIfNotExists - Flag to specify behavior when the database does not exist: if set to
false, throw an exception, if set to true, do nothing.Catalog.DatabaseNotExistException - if the given database is not exist and ignoreIfNotExists is
falsepublic List<String> listTables(String databaseName) throws Catalog.DatabaseNotExistException
CatalogNOTE: System tables will not be listed.
listTables in interface CatalogCatalog.DatabaseNotExistException - if the database does not existpublic PagedList<String> listTablesPaged(String databaseName, @Nullable Integer maxResults, @Nullable String pageToken, @Nullable String tableNamePattern) throws Catalog.DatabaseNotExistException
CatalogNOTE: System tables will not be listed.
listTablesPaged in interface CatalogdatabaseName - Name of the database to list tables.maxResults - Optional parameter indicating the maximum number of results to include in
the result. If maxResults is not specified or set to 0, will return the default number of
max results.pageToken - Optional parameter indicating the next page token allows list to be start
from a specific point.tableNamePattern - A sql LIKE pattern (%) for table names. All tables will be returned
if not set or empty. Currently, only prefix matching is supported.Catalog.supportsListObjectsPaged().Catalog.DatabaseNotExistException - if the database does not exist.public PagedList<Table> listTableDetailsPaged(String db, @Nullable Integer maxResults, @Nullable String pageToken, @Nullable String tableNamePattern) throws Catalog.DatabaseNotExistException
CatalogNOTE: System tables will not be listed.
listTableDetailsPaged in interface Catalogdb - Name of the database to list table details.maxResults - Optional parameter indicating the maximum number of results to include in
the result. If maxResults is not specified or set to 0, will return the default number of
max results.pageToken - Optional parameter indicating the next page token allows list to be start
from a specific point.tableNamePattern - A sql LIKE pattern (%) for table names. All table details will be
returned if not set or empty. Currently, only prefix matching is supported.Catalog.supportsListObjectsPaged().Catalog.DatabaseNotExistException - if the database does not existpublic PagedList<String> listTablesPagedGlobally(@Nullable String databaseNamePattern, @Nullable String tableNamePattern, @Nullable Integer maxResults, @Nullable String pageToken)
CatalogNOTE: System tables will not be listed.
listTablesPagedGlobally in interface CatalogdatabaseNamePattern - A sql LIKE pattern (%) for database names. All databases will be
returned if not set or empty. Currently, only prefix matching is supported.tableNamePattern - A sql LIKE pattern (%) for table names. All tables will be returned
if not set or empty. Currently, only prefix matching is supported.maxResults - Optional parameter indicating the maximum number of results to include in
the result. If maxResults is not specified or set to 0, will return the default number of
max results.pageToken - Optional parameter indicating the next page token allows list to be start
from a specific point.public Table getTable(Identifier identifier) throws Catalog.TableNotExistException
CataloggetTable in interface Catalogidentifier - Path of the tableCatalog.TableNotExistException - if the target does not existpublic Optional<TableSnapshot> loadSnapshot(Identifier identifier) throws Catalog.TableNotExistException
CatalogIdentifier.loadSnapshot in interface Catalogidentifier - Path of the tableCatalog.TableNotExistException - if the target does not existpublic Optional<Snapshot> loadSnapshot(Identifier identifier, String version) throws Catalog.TableNotExistException
CatalogloadSnapshot in interface Catalogidentifier - Path of the tableversion - version to snapshotCatalog.TableNotExistException - if the target does not existpublic PagedList<Snapshot> listSnapshotsPaged(Identifier identifier, @Nullable Integer maxResults, @Nullable String pageToken) throws Catalog.TableNotExistException
CataloglistSnapshotsPaged in interface Catalogidentifier - path of the table to list partitionsmaxResults - Optional parameter indicating the maximum number of results to include in
the result. If maxResults is not specified or set to 0, will return the default number of
max results.pageToken - Optional parameter indicating the next page token allows list to be start
from a specific point.Catalog.supportsListObjectsPaged().Catalog.TableNotExistException - if the table does not existpublic boolean supportsListObjectsPaged()
CatalogCatalog.listTablesPaged(String, Integer, String,
String) would fall back to Catalog.listTables(String).
Catalog.listDatabasesPaged(Integer, String, String).
Catalog.listTablesPaged(String, Integer, String, String).
Catalog.listTableDetailsPaged(String, Integer, String, String).
Catalog.listViewsPaged(String, Integer, String, String).
Catalog.listViewDetailsPaged(String, Integer, String, String).
Catalog.listPartitionsPaged(Identifier, Integer, String, String).
supportsListObjectsPaged in interface Catalogpublic boolean supportsListByPattern()
CatalogCatalog.listDatabasesPaged(Integer, String, String).
Catalog.listTablesPaged(String, Integer, String, String).
Catalog.listTableDetailsPaged(String, Integer, String, String).
Catalog.listViewsPaged(String, Integer, String, String).
Catalog.listViewDetailsPaged(String, Integer, String, String).
Catalog.listPartitionsPaged(Identifier, Integer, String, String).
supportsListByPattern in interface Catalogpublic boolean supportsVersionManagement()
CatalogUnsupportedOperationException, affect the following methods:
#commitSnapshot(Identifier, Snapshot, List).
Catalog.loadSnapshot(Identifier).
Catalog.rollbackTo(Identifier, Instant).
Catalog.createBranch(Identifier, String, String).
Catalog.dropBranch(Identifier, String).
Catalog.listBranches(Identifier).
supportsVersionManagement in interface Catalogpublic boolean commitSnapshot(Identifier identifier, @Nullable String tableUuid, Snapshot snapshot, List<PartitionStatistics> statistics) throws Catalog.TableNotExistException
CatalogSnapshot for table identified by the given Identifier.commitSnapshot in interface Catalogidentifier - Path of the tabletableUuid - Uuid of the table to avoid wrong commitsnapshot - Snapshot to be committedstatistics - statistics information of this changeCatalog.TableNotExistException - if the target does not existpublic void rollbackTo(Identifier identifier, Instant instant) throws Catalog.TableNotExistException
CatalogIdentifier and instant.rollbackTo in interface Catalogidentifier - path of the tableinstant - like snapshotId or tagNameCatalog.TableNotExistException - if the table does not existpublic void createTable(Identifier identifier, Schema schema, boolean ignoreIfExists) throws Catalog.TableAlreadyExistException, Catalog.DatabaseNotExistException
CatalogNOTE: System tables can not be created.
createTable in interface Catalogidentifier - path of the table to be createdschema - the table definitionignoreIfExists - flag to specify behavior when a table already exists at the given path:
if set to false, it throws a TableAlreadyExistException, if set to true, do nothing.Catalog.TableAlreadyExistException - if table already exists and ignoreIfExists is falseCatalog.DatabaseNotExistException - if the database in identifier doesn't existpublic void renameTable(Identifier fromTable, Identifier toTable, boolean ignoreIfNotExists) throws Catalog.TableNotExistException, Catalog.TableAlreadyExistException
CatalogNOTE: If you use object storage, such as S3 or OSS, please use this syntax carefully, because the renaming of object storage is not atomic, and only partial files may be moved in case of failure.
NOTE: System tables can not be renamed.
renameTable in interface CatalogfromTable - the name of the table which need to renametoTable - the new tableignoreIfNotExists - Flag to specify behavior when the table does not exist: if set to
false, throw an exception, if set to true, do nothing.Catalog.TableNotExistException - if the fromTable does not existCatalog.TableAlreadyExistException - if the toTable already existspublic void alterTable(Identifier identifier, List<SchemaChange> changes, boolean ignoreIfNotExists) throws Catalog.TableNotExistException, Catalog.ColumnAlreadyExistException, Catalog.ColumnNotExistException
CatalogSchemaChanges.
NOTE: System tables can not be altered.
alterTable in interface Catalogidentifier - path of the table to be modifiedchanges - the schema changesignoreIfNotExists - flag to specify behavior when the table does not exist: if set to
false, throw an exception, if set to true, do nothing.Catalog.TableNotExistException - if the table does not existCatalog.ColumnAlreadyExistExceptionCatalog.ColumnNotExistExceptionpublic List<String> authTableQuery(Identifier identifier, @Nullable List<String> select) throws Catalog.TableNotExistException
CatalogauthTableQuery in interface Catalogidentifier - path of the table to alter partitionsselect - selected fields, null if select allCatalog.TableNotExistException - if the table does not existpublic void dropTable(Identifier identifier, boolean ignoreIfNotExists) throws Catalog.TableNotExistException
CatalogNOTE: System tables can not be dropped.
dropTable in interface Catalogidentifier - Path of the table to be droppedignoreIfNotExists - Flag to specify behavior when the table does not exist: if set to
false, throw an exception, if set to true, do nothing.Catalog.TableNotExistException - if the table does not existpublic void markDonePartitions(Identifier identifier, List<Map<String,String>> partitions) throws Catalog.TableNotExistException
CatalogmarkDonePartitions in interface Catalogidentifier - path of the table to mark done partitionspartitions - partitions to be marked doneCatalog.TableNotExistException - if the table does not existpublic List<Partition> listPartitions(Identifier identifier) throws Catalog.TableNotExistException
CataloglistPartitions in interface Catalogidentifier - path of the table to list partitionsCatalog.TableNotExistException - if the table does not existpublic PagedList<Partition> listPartitionsPaged(Identifier identifier, @Nullable Integer maxResults, @Nullable String pageToken, @Nullable String partitionNamePattern) throws Catalog.TableNotExistException
CataloglistPartitionsPaged in interface Catalogidentifier - path of the table to list partitionsmaxResults - Optional parameter indicating the maximum number of results to include in
the result. If maxResults is not specified or set to 0, will return the default number of
max results.pageToken - Optional parameter indicating the next page token allows list to be start
from a specific point.partitionNamePattern - A sql LIKE pattern (%) for partition names. All partitions will
be returned if not set or empty. Currently, only prefix matching is supported.Catalog.supportsListObjectsPaged().Catalog.TableNotExistException - if the table does not existpublic void createBranch(Identifier identifier, String branch, @Nullable String fromTag) throws Catalog.TableNotExistException, Catalog.BranchAlreadyExistException, Catalog.TagNotExistException
Catalog#fromTag, a branch will be created from the tag and the
data files will be inherited from it.createBranch in interface Catalogidentifier - path of the table, cannot be system or branch name.branch - the branch namefromTag - from the tagCatalog.TableNotExistException - if the table in identifier doesn't existCatalog.BranchAlreadyExistException - if the branch already existsCatalog.TagNotExistException - if the tag doesn't existpublic void dropBranch(Identifier identifier, String branch) throws Catalog.BranchNotExistException
CatalogdropBranch in interface Catalogidentifier - path of the table, cannot be system or branch name.branch - the branch nameCatalog.BranchNotExistException - if the branch doesn't existpublic void fastForward(Identifier identifier, String branch) throws Catalog.BranchNotExistException
CatalogfastForward in interface Catalogidentifier - path of the table, cannot be system or branch name.branch - the branch nameCatalog.BranchNotExistException - if the branch doesn't existpublic List<String> listBranches(Identifier identifier) throws Catalog.TableNotExistException
CataloglistBranches in interface Catalogidentifier - path of the table, cannot be system or branch name.Catalog.TableNotExistException - if the table in identifier doesn't existpublic void createPartitions(Identifier identifier, List<Map<String,String>> partitions) throws Catalog.TableNotExistException
CatalogcreatePartitions in interface Catalogidentifier - path of the table to create partitionspartitions - partitions to be createdCatalog.TableNotExistException - if the table does not existpublic void dropPartitions(Identifier identifier, List<Map<String,String>> partitions) throws Catalog.TableNotExistException
CatalogdropPartitions in interface Catalogidentifier - path of the table to drop partitionspartitions - partitions to be deletedCatalog.TableNotExistException - if the table does not existpublic void alterPartitions(Identifier identifier, List<PartitionStatistics> partitions) throws Catalog.TableNotExistException
CatalogalterPartitions in interface Catalogidentifier - path of the table to alter partitionspartitions - partitions to be alteredCatalog.TableNotExistException - if the table does not existpublic List<String> listFunctions(String databaseName) throws Catalog.DatabaseNotExistException
CataloglistFunctions in interface CatalogCatalog.DatabaseNotExistException - if the database does not existpublic Function getFunction(Identifier identifier) throws Catalog.FunctionNotExistException
CataloggetFunction in interface Catalogidentifier - Path of the function to getCatalog.FunctionNotExistException - if the function does not existpublic void createFunction(Identifier identifier, Function function, boolean ignoreIfExists) throws Catalog.FunctionAlreadyExistException, Catalog.DatabaseNotExistException
CatalogNOTE: System functions can not be created.
createFunction in interface Catalogidentifier - path of the function to be createdfunction - the function definitionignoreIfExists - flag to specify behavior when a function already exists at the given
path: if set to false, it throws a FunctionAlreadyExistException, if set to true, do
nothing.Catalog.FunctionAlreadyExistException - if function already exists and ignoreIfExists is falseCatalog.DatabaseNotExistException - if the database in identifier doesn't existpublic void dropFunction(Identifier identifier, boolean ignoreIfNotExists) throws Catalog.FunctionNotExistException
CatalogdropFunction in interface Catalogidentifier - path of the function to be createdignoreIfNotExists - Flag to specify behavior when the function does not existCatalog.FunctionNotExistException - if the function doesn't existpublic void alterFunction(Identifier identifier, List<FunctionChange> changes, boolean ignoreIfNotExists) throws Catalog.FunctionNotExistException, Catalog.DefinitionAlreadyExistException, Catalog.DefinitionNotExistException
CatalogalterFunction in interface Catalogidentifier - path of the function to be createdchanges - the function changesignoreIfNotExists - Flag to specify behavior when the function does not existCatalog.FunctionNotExistException - if the function doesn't existCatalog.DefinitionAlreadyExistExceptionCatalog.DefinitionNotExistExceptionpublic View getView(Identifier identifier) throws Catalog.ViewNotExistException
CatalogView identified by the given Identifier.getView in interface Catalogidentifier - Path of the viewCatalog.ViewNotExistException - if the target does not existpublic void dropView(Identifier identifier, boolean ignoreIfNotExists) throws Catalog.ViewNotExistException
CatalogdropView in interface Catalogidentifier - Path of the view to be droppedignoreIfNotExists - Flag to specify behavior when the view does not exist: if set to
false, throw an exception, if set to true, do nothing.Catalog.ViewNotExistException - if the view does not existpublic void createView(Identifier identifier, View view, boolean ignoreIfExists) throws Catalog.ViewAlreadyExistException, Catalog.DatabaseNotExistException
CatalogcreateView in interface Catalogidentifier - path of the view to be createdview - the view definitionignoreIfExists - flag to specify behavior when a view already exists at the given path:
if set to false, it throws a ViewAlreadyExistException, if set to true, do nothing.Catalog.ViewAlreadyExistException - if view already exists and ignoreIfExists is falseCatalog.DatabaseNotExistException - if the database in identifier doesn't existpublic List<String> listViews(String databaseName) throws Catalog.DatabaseNotExistException
CataloglistViews in interface CatalogCatalog.DatabaseNotExistException - if the database does not existpublic PagedList<String> listViewsPaged(String databaseName, @Nullable Integer maxResults, @Nullable String pageToken, @Nullable String viewNamePattern) throws Catalog.DatabaseNotExistException
CataloglistViewsPaged in interface CatalogdatabaseName - Name of the database to list views.maxResults - Optional parameter indicating the maximum number of results to include in
the result. If maxResults is not specified or set to 0, will return the default number of
max results.pageToken - Optional parameter indicating the next page token allows list to be start
from a specific point.viewNamePattern - A sql LIKE pattern (%) for view names. All views will be returned if
not set or empty. Currently, only prefix matching is supported.Catalog.supportsListObjectsPaged().Catalog.DatabaseNotExistException - if the database does not existpublic PagedList<View> listViewDetailsPaged(String db, @Nullable Integer maxResults, @Nullable String pageToken, @Nullable String viewNamePattern) throws Catalog.DatabaseNotExistException
CataloglistViewDetailsPaged in interface Catalogdb - Name of the database to list views.maxResults - Optional parameter indicating the maximum number of results to include in
the result. If maxResults is not specified or set to 0, will return the default number of
max results.pageToken - Optional parameter indicating the next page token allows list to be start
from a specific point.viewNamePattern - A sql LIKE pattern (%) for view names. All view details will be
returned if not set or empty. Currently, only prefix matching is supported.Catalog.supportsListObjectsPaged().Catalog.DatabaseNotExistException - if the database does not existpublic PagedList<String> listViewsPagedGlobally(@Nullable String databaseNamePattern, @Nullable String viewNamePattern, @Nullable Integer maxResults, @Nullable String pageToken)
CatalogNOTE: System tables will not be listed.
listViewsPagedGlobally in interface CatalogdatabaseNamePattern - A sql LIKE pattern (%) for database names. All databases will be
returned if not set or empty. Currently, only prefix matching is supported.viewNamePattern - A sql LIKE pattern (%) for view names. All views will be returned if
not set or empty. Currently, only prefix matching is supported.maxResults - Optional parameter indicating the maximum number of results to include in
the result. If maxResults is not specified or set to 0, will return the default number of
max results.pageToken - Optional parameter indicating the next page token allows list to be start
from a specific point.public void renameView(Identifier fromView, Identifier toView, boolean ignoreIfNotExists) throws Catalog.ViewNotExistException, Catalog.ViewAlreadyExistException
CatalogrenameView in interface CatalogfromView - identifier of the view to renametoView - new view identifierCatalog.ViewNotExistException - if the fromView does not existCatalog.ViewAlreadyExistException - if the toView already existspublic void alterView(Identifier identifier, List<ViewChange> viewChanges, boolean ignoreIfNotExists) throws Catalog.ViewNotExistException, Catalog.DialectAlreadyExistException, Catalog.DialectNotExistException
CatalogalterView in interface Catalogidentifier - identifier of the view to alterviewChanges - - changes of viewignoreIfNotExists - Flag to specify behavior when the view does not existCatalog.ViewNotExistException - if the view does not existCatalog.DialectAlreadyExistException - if the dialect already existsCatalog.DialectNotExistException - if the dialect not existspublic boolean caseSensitive()
CatalogcaseSensitive in interface Catalogpublic void close()
throws Exception
close in interface AutoCloseableExceptionprotected GetTableTokenResponse loadTableToken(Identifier identifier) throws Catalog.TableNotExistException
Catalog.TableNotExistExceptionCopyright © 2023–2025 The Apache Software Foundation. All rights reserved.