Package org.apache.iceberg.aws.dynamodb
Class DynamoDbCatalog
- java.lang.Object
- 
- org.apache.iceberg.BaseMetastoreCatalog
- 
- org.apache.iceberg.aws.dynamodb.DynamoDbCatalog
 
 
- 
- All Implemented Interfaces:
- java.io.Closeable,- java.lang.AutoCloseable,- org.apache.hadoop.conf.Configurable,- Catalog,- SupportsNamespaces
 
 public class DynamoDbCatalog extends BaseMetastoreCatalog implements java.io.Closeable, SupportsNamespaces, org.apache.hadoop.conf.Configurable DynamoDB implementation of Iceberg catalog
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.apache.iceberg.BaseMetastoreCatalogBaseMetastoreCatalog.BaseMetastoreCatalogTableBuilder
 - 
Nested classes/interfaces inherited from interface org.apache.iceberg.catalog.CatalogCatalog.TableBuilder
 
- 
 - 
Constructor SummaryConstructors Constructor Description DynamoDbCatalog()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidcreateNamespace(Namespace namespace, java.util.Map<java.lang.String,java.lang.String> metadata)Create a namespace in the catalog.static java.lang.StringdefaultLocationProperty()The property used to set a default location for tables in a namespace.protected java.lang.StringdefaultWarehouseLocation(TableIdentifier tableIdentifier)booleandropNamespace(Namespace namespace)Drop a namespace.booleandropTable(TableIdentifier identifier, boolean purge)Drop a table; optionally delete data and metadata files.org.apache.hadoop.conf.ConfigurationgetConf()voidinitialize(java.lang.String name, java.util.Map<java.lang.String,java.lang.String> properties)Initialize a catalog given a custom name and a map of catalog properties.java.util.List<Namespace>listNamespaces(Namespace namespace)List namespaces from the namespace.java.util.List<TableIdentifier>listTables(Namespace namespace)Return all the identifiers under this namespace.java.util.Map<java.lang.String,java.lang.String>loadNamespaceMetadata(Namespace namespace)Load metadata properties for a namespace.java.lang.Stringname()Return the name for this catalog.protected TableOperationsnewTableOps(TableIdentifier tableIdentifier)booleanremoveProperties(Namespace namespace, java.util.Set<java.lang.String> properties)Remove a set of property keys from a namespace in the catalog.voidrenameTable(TableIdentifier from, TableIdentifier to)Rename a table.voidsetConf(org.apache.hadoop.conf.Configuration conf)booleansetProperties(Namespace namespace, java.util.Map<java.lang.String,java.lang.String> properties)Set a collection of properties on a namespace in the catalog.- 
Methods inherited from class org.apache.iceberg.BaseMetastoreCatalogbuildTable, fullTableName, isValidIdentifier, loadTable, properties, toString
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface org.apache.iceberg.catalog.CatalogcreateTable, createTable, createTable, createTable, dropTable, invalidateTable, newCreateTableTransaction, newCreateTableTransaction, newCreateTableTransaction, newCreateTableTransaction, newReplaceTableTransaction, newReplaceTableTransaction, newReplaceTableTransaction, newReplaceTableTransaction, registerTable, tableExists
 - 
Methods inherited from interface org.apache.iceberg.catalog.SupportsNamespacescreateNamespace, listNamespaces, namespaceExists
 
- 
 
- 
- 
- 
Method Detail- 
initializepublic void initialize(java.lang.String name, java.util.Map<java.lang.String,java.lang.String> properties)Description copied from interface:CatalogInitialize a catalog given a custom name and a map of catalog properties.A custom Catalog implementation must have a no-arg constructor. A compute engine like Spark or Flink will first initialize the catalog without any arguments, and then call this method to complete catalog initialization with properties passed into the engine. - Specified by:
- initializein interface- Catalog
- Parameters:
- name- a custom name for the catalog
- properties- catalog properties
 
 - 
namepublic java.lang.String name() Description copied from interface:CatalogReturn the name for this catalog.
 - 
newTableOpsprotected TableOperations newTableOps(TableIdentifier tableIdentifier) - Specified by:
- newTableOpsin class- BaseMetastoreCatalog
 
 - 
defaultWarehouseLocationprotected java.lang.String defaultWarehouseLocation(TableIdentifier tableIdentifier) - Specified by:
- defaultWarehouseLocationin class- BaseMetastoreCatalog
 
 - 
createNamespacepublic void createNamespace(Namespace namespace, java.util.Map<java.lang.String,java.lang.String> metadata) Description copied from interface:SupportsNamespacesCreate a namespace in the catalog.- Specified by:
- createNamespacein interface- SupportsNamespaces
- Parameters:
- namespace- a multi-part namespace
- metadata- a string Map of properties for the given namespace
 
 - 
listNamespacespublic java.util.List<Namespace> listNamespaces(Namespace namespace) throws NoSuchNamespaceException Description copied from interface:SupportsNamespacesList namespaces from the namespace.For example, if table a.b.t exists, use 'SELECT NAMESPACE IN a' this method must return Namepace.of("a","b") Namespace.- Specified by:
- listNamespacesin interface- SupportsNamespaces
- Returns:
- a List of namespace Namespacenames
- Throws:
- NoSuchNamespaceException- If the namespace does not exist (optional)
 
 - 
loadNamespaceMetadatapublic java.util.Map<java.lang.String,java.lang.String> loadNamespaceMetadata(Namespace namespace) throws NoSuchNamespaceException Description copied from interface:SupportsNamespacesLoad metadata properties for a namespace.- Specified by:
- loadNamespaceMetadatain interface- SupportsNamespaces
- Parameters:
- namespace- a namespace.- Namespace
- Returns:
- a string map of properties for the given namespace
- Throws:
- NoSuchNamespaceException- If the namespace does not exist (optional)
 
 - 
dropNamespacepublic boolean dropNamespace(Namespace namespace) throws NamespaceNotEmptyException Description copied from interface:SupportsNamespacesDrop a namespace. If the namespace exists and was dropped, this will return true.- Specified by:
- dropNamespacein interface- SupportsNamespaces
- Parameters:
- namespace- a namespace.- Namespace
- Returns:
- true if the namespace was dropped, false otherwise.
- Throws:
- NamespaceNotEmptyException- If the namespace is not empty
 
 - 
setPropertiespublic boolean setProperties(Namespace namespace, java.util.Map<java.lang.String,java.lang.String> properties) throws NoSuchNamespaceException Description copied from interface:SupportsNamespacesSet a collection of properties on a namespace in the catalog.Properties that are not in the given map are not modified or removed by this method. - Specified by:
- setPropertiesin interface- SupportsNamespaces
- Parameters:
- namespace- a namespace.- Namespace
- properties- a collection of metadata to apply to the namespace
- Throws:
- NoSuchNamespaceException- If the namespace does not exist (optional)
 
 - 
removePropertiespublic boolean removeProperties(Namespace namespace, java.util.Set<java.lang.String> properties) throws NoSuchNamespaceException Description copied from interface:SupportsNamespacesRemove a set of property keys from a namespace in the catalog.Properties that are not in the given set are not modified or removed by this method. - Specified by:
- removePropertiesin interface- SupportsNamespaces
- Parameters:
- namespace- a namespace.- Namespace
- properties- a collection of metadata to apply to the namespace
- Throws:
- NoSuchNamespaceException- If the namespace does not exist (optional)
 
 - 
listTablespublic java.util.List<TableIdentifier> listTables(Namespace namespace) Description copied from interface:CatalogReturn all the identifiers under this namespace.- Specified by:
- listTablesin interface- Catalog
- Parameters:
- namespace- a namespace
- Returns:
- a list of identifiers for tables
 
 - 
dropTablepublic boolean dropTable(TableIdentifier identifier, boolean purge) Description copied from interface:CatalogDrop a table; optionally delete data and metadata files.If purge is set to true the implementation should delete all data and metadata files. 
 - 
renameTablepublic void renameTable(TableIdentifier from, TableIdentifier to) Description copied from interface:CatalogRename a table.- Specified by:
- renameTablein interface- Catalog
- Parameters:
- from- identifier of the table to rename
- to- new table name
 
 - 
setConfpublic void setConf(org.apache.hadoop.conf.Configuration conf) - Specified by:
- setConfin interface- org.apache.hadoop.conf.Configurable
 
 - 
getConfpublic org.apache.hadoop.conf.Configuration getConf() - Specified by:
- getConfin interface- org.apache.hadoop.conf.Configurable
 
 - 
closepublic void close() throws java.io.IOException- Specified by:
- closein interface- java.lang.AutoCloseable
- Specified by:
- closein interface- java.io.Closeable
- Throws:
- java.io.IOException
 
 - 
defaultLocationPropertypublic static java.lang.String defaultLocationProperty() The property used to set a default location for tables in a namespace. CallsetProperties(Namespace, Map)to set a path value using this property for a namespace, then all tables in the namespace will have default table root path under that given path.- Returns:
- default location property key
 
 
- 
 
-