Class TrinoRestCatalog
java.lang.Object
io.trino.plugin.iceberg.catalog.rest.TrinoRestCatalog
- All Implemented Interfaces:
TrinoCatalog
-
Constructor Summary
ConstructorsConstructorDescriptionTrinoRestCatalog(org.apache.iceberg.rest.RESTSessionCatalog restSessionCatalog, CatalogName catalogName, IcebergRestCatalogConfig.SessionType sessionType, String trinoVersion, boolean useUniqueTableLocation) -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateMaterializedView(ConnectorSession session, SchemaTableName viewName, ConnectorMaterializedViewDefinition definition, boolean replace, boolean ignoreExisting) voidcreateNamespace(ConnectorSession session, String namespace, Map<String, Object> properties, TrinoPrincipal owner) voidcreateView(ConnectorSession session, SchemaTableName schemaViewName, ConnectorViewDefinition definition, boolean replace) defaultTableLocation(ConnectorSession session, SchemaTableName schemaTableName) voiddropCorruptedTable(ConnectorSession session, SchemaTableName schemaTableName) voiddropMaterializedView(ConnectorSession session, SchemaTableName viewName) voiddropNamespace(ConnectorSession session, String namespace) voiddropTable(ConnectorSession session, SchemaTableName schemaTableName) voiddropView(ConnectorSession session, SchemaTableName schemaViewName) getMaterializedView(ConnectorSession session, SchemaTableName viewName) getNamespacePrincipal(ConnectorSession session, String namespace) getView(ConnectorSession session, SchemaTableName viewName) getViews(ConnectorSession session, Optional<String> namespace) listMaterializedViews(ConnectorSession session, Optional<String> namespace) listNamespaces(ConnectorSession session) listTables(ConnectorSession session, Optional<String> namespace) listViews(ConnectorSession session, Optional<String> namespace) loadNamespaceMetadata(ConnectorSession session, String namespace) org.apache.iceberg.TableloadTable(ConnectorSession session, SchemaTableName schemaTableName) load an Iceberg tablebooleannamespaceExists(ConnectorSession session, String namespace) org.apache.iceberg.TransactionnewCreateTableTransaction(ConnectorSession session, SchemaTableName schemaTableName, org.apache.iceberg.Schema schema, org.apache.iceberg.PartitionSpec partitionSpec, org.apache.iceberg.SortOrder sortOrder, String location, Map<String, String> properties) redirectTable(ConnectorSession session, SchemaTableName tableName, String hiveCatalogName) voidregisterTable(ConnectorSession session, SchemaTableName tableName, org.apache.iceberg.TableMetadata tableMetadata) voidrenameMaterializedView(ConnectorSession session, SchemaTableName source, SchemaTableName target) voidrenameNamespace(ConnectorSession session, String source, String target) voidrenameTable(ConnectorSession session, SchemaTableName from, SchemaTableName to) voidrenameView(ConnectorSession session, SchemaTableName source, SchemaTableName target) voidsetNamespacePrincipal(ConnectorSession session, String namespace, TrinoPrincipal principal) voidsetTablePrincipal(ConnectorSession session, SchemaTableName schemaTableName, TrinoPrincipal principal) voidsetViewPrincipal(ConnectorSession session, SchemaTableName schemaViewName, TrinoPrincipal principal) streamRelationColumns(ConnectorSession session, Optional<String> namespace, UnaryOperator<Set<SchemaTableName>> relationFilter, Predicate<SchemaTableName> isRedirected) streamRelationComments(ConnectorSession session, Optional<String> namespace, UnaryOperator<Set<SchemaTableName>> relationFilter, Predicate<SchemaTableName> isRedirected) tryGetColumnMetadata(ConnectorSession session, List<SchemaTableName> tables) Bulk load column metadata.voidunregisterTable(ConnectorSession session, SchemaTableName tableName) voidupdateColumnComment(ConnectorSession session, SchemaTableName schemaTableName, ColumnIdentity columnIdentity, Optional<String> comment) voidupdateMaterializedViewColumnComment(ConnectorSession session, SchemaTableName schemaViewName, String columnName, Optional<String> comment) voidupdateTableComment(ConnectorSession session, SchemaTableName schemaTableName, Optional<String> comment) voidupdateViewColumnComment(ConnectorSession session, SchemaTableName schemaViewName, String columnName, Optional<String> comment) voidupdateViewComment(ConnectorSession session, SchemaTableName schemaViewName, Optional<String> comment)
-
Constructor Details
-
TrinoRestCatalog
public TrinoRestCatalog(org.apache.iceberg.rest.RESTSessionCatalog restSessionCatalog, CatalogName catalogName, IcebergRestCatalogConfig.SessionType sessionType, String trinoVersion, boolean useUniqueTableLocation)
-
-
Method Details
-
namespaceExists
- Specified by:
namespaceExistsin interfaceTrinoCatalog
-
listNamespaces
- Specified by:
listNamespacesin interfaceTrinoCatalog
-
dropNamespace
- Specified by:
dropNamespacein interfaceTrinoCatalog
-
loadNamespaceMetadata
- Specified by:
loadNamespaceMetadatain interfaceTrinoCatalog
-
getNamespacePrincipal
- Specified by:
getNamespacePrincipalin interfaceTrinoCatalog
-
createNamespace
public void createNamespace(ConnectorSession session, String namespace, Map<String, Object> properties, TrinoPrincipal owner) - Specified by:
createNamespacein interfaceTrinoCatalog
-
setNamespacePrincipal
public void setNamespacePrincipal(ConnectorSession session, String namespace, TrinoPrincipal principal) - Specified by:
setNamespacePrincipalin interfaceTrinoCatalog
-
renameNamespace
- Specified by:
renameNamespacein interfaceTrinoCatalog
-
listTables
- Specified by:
listTablesin interfaceTrinoCatalog
-
streamRelationColumns
public Optional<Iterator<RelationColumnsMetadata>> streamRelationColumns(ConnectorSession session, Optional<String> namespace, UnaryOperator<Set<SchemaTableName>> relationFilter, Predicate<SchemaTableName> isRedirected) - Specified by:
streamRelationColumnsin interfaceTrinoCatalog
-
streamRelationComments
public Optional<Iterator<RelationCommentMetadata>> streamRelationComments(ConnectorSession session, Optional<String> namespace, UnaryOperator<Set<SchemaTableName>> relationFilter, Predicate<SchemaTableName> isRedirected) - Specified by:
streamRelationCommentsin interfaceTrinoCatalog
-
newCreateTableTransaction
public org.apache.iceberg.Transaction newCreateTableTransaction(ConnectorSession session, SchemaTableName schemaTableName, org.apache.iceberg.Schema schema, org.apache.iceberg.PartitionSpec partitionSpec, org.apache.iceberg.SortOrder sortOrder, String location, Map<String, String> properties) - Specified by:
newCreateTableTransactionin interfaceTrinoCatalog
-
registerTable
public void registerTable(ConnectorSession session, SchemaTableName tableName, org.apache.iceberg.TableMetadata tableMetadata) - Specified by:
registerTablein interfaceTrinoCatalog
-
unregisterTable
- Specified by:
unregisterTablein interfaceTrinoCatalog
-
dropTable
- Specified by:
dropTablein interfaceTrinoCatalog
-
dropCorruptedTable
- Specified by:
dropCorruptedTablein interfaceTrinoCatalog
-
renameTable
- Specified by:
renameTablein interfaceTrinoCatalog
-
loadTable
public org.apache.iceberg.Table loadTable(ConnectorSession session, SchemaTableName schemaTableName) Description copied from interface:TrinoCatalogload an Iceberg table- Specified by:
loadTablein interfaceTrinoCatalog- Parameters:
session- Trino sessionschemaTableName- Trino schema and table name- Returns:
- Iceberg table loaded
-
tryGetColumnMetadata
public Map<SchemaTableName,List<ColumnMetadata>> tryGetColumnMetadata(ConnectorSession session, List<SchemaTableName> tables) Description copied from interface:TrinoCatalogBulk load column metadata. The returned map may contain fewer entries then asked for.- Specified by:
tryGetColumnMetadatain interfaceTrinoCatalog
-
updateTableComment
public void updateTableComment(ConnectorSession session, SchemaTableName schemaTableName, Optional<String> comment) - Specified by:
updateTableCommentin interfaceTrinoCatalog
-
defaultTableLocation
- Specified by:
defaultTableLocationin interfaceTrinoCatalog
-
setTablePrincipal
public void setTablePrincipal(ConnectorSession session, SchemaTableName schemaTableName, TrinoPrincipal principal) - Specified by:
setTablePrincipalin interfaceTrinoCatalog
-
createView
public void createView(ConnectorSession session, SchemaTableName schemaViewName, ConnectorViewDefinition definition, boolean replace) - Specified by:
createViewin interfaceTrinoCatalog
-
renameView
- Specified by:
renameViewin interfaceTrinoCatalog
-
setViewPrincipal
public void setViewPrincipal(ConnectorSession session, SchemaTableName schemaViewName, TrinoPrincipal principal) - Specified by:
setViewPrincipalin interfaceTrinoCatalog
-
dropView
- Specified by:
dropViewin interfaceTrinoCatalog
-
listViews
- Specified by:
listViewsin interfaceTrinoCatalog
-
getViews
public Map<SchemaTableName,ConnectorViewDefinition> getViews(ConnectorSession session, Optional<String> namespace) - Specified by:
getViewsin interfaceTrinoCatalog
-
getView
public Optional<ConnectorViewDefinition> getView(ConnectorSession session, SchemaTableName viewName) - Specified by:
getViewin interfaceTrinoCatalog
-
listMaterializedViews
public List<SchemaTableName> listMaterializedViews(ConnectorSession session, Optional<String> namespace) - Specified by:
listMaterializedViewsin interfaceTrinoCatalog
-
createMaterializedView
public void createMaterializedView(ConnectorSession session, SchemaTableName viewName, ConnectorMaterializedViewDefinition definition, boolean replace, boolean ignoreExisting) - Specified by:
createMaterializedViewin interfaceTrinoCatalog
-
updateMaterializedViewColumnComment
public void updateMaterializedViewColumnComment(ConnectorSession session, SchemaTableName schemaViewName, String columnName, Optional<String> comment) - Specified by:
updateMaterializedViewColumnCommentin interfaceTrinoCatalog
-
dropMaterializedView
- Specified by:
dropMaterializedViewin interfaceTrinoCatalog
-
getMaterializedView
public Optional<ConnectorMaterializedViewDefinition> getMaterializedView(ConnectorSession session, SchemaTableName viewName) - Specified by:
getMaterializedViewin interfaceTrinoCatalog
-
renameMaterializedView
public void renameMaterializedView(ConnectorSession session, SchemaTableName source, SchemaTableName target) - Specified by:
renameMaterializedViewin interfaceTrinoCatalog
-
updateColumnComment
public void updateColumnComment(ConnectorSession session, SchemaTableName schemaTableName, ColumnIdentity columnIdentity, Optional<String> comment) - Specified by:
updateColumnCommentin interfaceTrinoCatalog
-
redirectTable
public Optional<CatalogSchemaTableName> redirectTable(ConnectorSession session, SchemaTableName tableName, String hiveCatalogName) - Specified by:
redirectTablein interfaceTrinoCatalog
-
updateViewComment
public void updateViewComment(ConnectorSession session, SchemaTableName schemaViewName, Optional<String> comment) - Specified by:
updateViewCommentin interfaceTrinoCatalog
-
updateViewColumnComment
public void updateViewColumnComment(ConnectorSession session, SchemaTableName schemaViewName, String columnName, Optional<String> comment) - Specified by:
updateViewColumnCommentin interfaceTrinoCatalog
-