public class HadoopCatalog extends BaseMetastoreCatalog implements java.io.Closeable, org.apache.iceberg.catalog.SupportsNamespaces
Catalog.createTable(org.apache.iceberg.catalog.TableIdentifier, org.apache.iceberg.Schema, org.apache.iceberg.PartitionSpec, java.lang.String, java.util.Map<java.lang.String, java.lang.String>)
,
Catalog.dropTable(org.apache.iceberg.catalog.TableIdentifier)
, the Catalog.renameTable(org.apache.iceberg.catalog.TableIdentifier, org.apache.iceberg.catalog.TableIdentifier)
is not supported yet.
Note: The HadoopCatalog requires that the underlying file system supports atomic rename.Constructor and Description |
---|
HadoopCatalog(org.apache.hadoop.conf.Configuration conf)
The constructor of the HadoopCatalog.
|
HadoopCatalog(org.apache.hadoop.conf.Configuration conf,
java.lang.String warehouseLocation)
The constructor of the HadoopCatalog.
|
HadoopCatalog(java.lang.String name,
org.apache.hadoop.conf.Configuration conf,
java.lang.String warehouseLocation)
The constructor of the HadoopCatalog.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
createNamespace(org.apache.iceberg.catalog.Namespace namespace,
java.util.Map<java.lang.String,java.lang.String> meta) |
org.apache.iceberg.Table |
createTable(org.apache.iceberg.catalog.TableIdentifier identifier,
org.apache.iceberg.Schema schema,
org.apache.iceberg.PartitionSpec spec,
java.lang.String location,
java.util.Map<java.lang.String,java.lang.String> properties) |
protected java.lang.String |
defaultWarehouseLocation(org.apache.iceberg.catalog.TableIdentifier tableIdentifier) |
boolean |
dropNamespace(org.apache.iceberg.catalog.Namespace namespace) |
boolean |
dropTable(org.apache.iceberg.catalog.TableIdentifier identifier,
boolean purge) |
protected boolean |
isValidIdentifier(org.apache.iceberg.catalog.TableIdentifier identifier) |
java.util.List<org.apache.iceberg.catalog.Namespace> |
listNamespaces(org.apache.iceberg.catalog.Namespace namespace) |
java.util.List<org.apache.iceberg.catalog.TableIdentifier> |
listTables(org.apache.iceberg.catalog.Namespace namespace) |
java.util.Map<java.lang.String,java.lang.String> |
loadNamespaceMetadata(org.apache.iceberg.catalog.Namespace namespace) |
protected java.lang.String |
name() |
protected TableOperations |
newTableOps(org.apache.iceberg.catalog.TableIdentifier identifier) |
boolean |
removeProperties(org.apache.iceberg.catalog.Namespace namespace,
java.util.Set<java.lang.String> properties) |
void |
renameTable(org.apache.iceberg.catalog.TableIdentifier from,
org.apache.iceberg.catalog.TableIdentifier to) |
boolean |
setProperties(org.apache.iceberg.catalog.Namespace namespace,
java.util.Map<java.lang.String,java.lang.String> properties) |
dropTableData, fullTableName, loadTable, newCreateTableTransaction, newReplaceTableTransaction, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public HadoopCatalog(java.lang.String name, org.apache.hadoop.conf.Configuration conf, java.lang.String warehouseLocation)
name
- The catalog nameconf
- The Hadoop configurationwarehouseLocation
- The location used as warehouse directorypublic HadoopCatalog(org.apache.hadoop.conf.Configuration conf, java.lang.String warehouseLocation)
conf
- The Hadoop configurationwarehouseLocation
- The location used as warehouse directorypublic HadoopCatalog(org.apache.hadoop.conf.Configuration conf)
fs.defaultFS
property
from the passed Hadoop configuration as its default file system, and use the default directory
iceberg/warehouse
as the warehouse directory.conf
- The Hadoop configurationprotected java.lang.String name()
name
in class BaseMetastoreCatalog
public java.util.List<org.apache.iceberg.catalog.TableIdentifier> listTables(org.apache.iceberg.catalog.Namespace namespace)
listTables
in interface org.apache.iceberg.catalog.Catalog
public org.apache.iceberg.Table createTable(org.apache.iceberg.catalog.TableIdentifier identifier, org.apache.iceberg.Schema schema, org.apache.iceberg.PartitionSpec spec, java.lang.String location, java.util.Map<java.lang.String,java.lang.String> properties)
createTable
in interface org.apache.iceberg.catalog.Catalog
createTable
in class BaseMetastoreCatalog
protected boolean isValidIdentifier(org.apache.iceberg.catalog.TableIdentifier identifier)
isValidIdentifier
in class BaseMetastoreCatalog
protected TableOperations newTableOps(org.apache.iceberg.catalog.TableIdentifier identifier)
newTableOps
in class BaseMetastoreCatalog
protected java.lang.String defaultWarehouseLocation(org.apache.iceberg.catalog.TableIdentifier tableIdentifier)
defaultWarehouseLocation
in class BaseMetastoreCatalog
public boolean dropTable(org.apache.iceberg.catalog.TableIdentifier identifier, boolean purge)
dropTable
in interface org.apache.iceberg.catalog.Catalog
public void renameTable(org.apache.iceberg.catalog.TableIdentifier from, org.apache.iceberg.catalog.TableIdentifier to)
renameTable
in interface org.apache.iceberg.catalog.Catalog
public void createNamespace(org.apache.iceberg.catalog.Namespace namespace, java.util.Map<java.lang.String,java.lang.String> meta)
createNamespace
in interface org.apache.iceberg.catalog.SupportsNamespaces
public java.util.List<org.apache.iceberg.catalog.Namespace> listNamespaces(org.apache.iceberg.catalog.Namespace namespace)
listNamespaces
in interface org.apache.iceberg.catalog.SupportsNamespaces
public boolean dropNamespace(org.apache.iceberg.catalog.Namespace namespace)
dropNamespace
in interface org.apache.iceberg.catalog.SupportsNamespaces
public boolean setProperties(org.apache.iceberg.catalog.Namespace namespace, java.util.Map<java.lang.String,java.lang.String> properties)
setProperties
in interface org.apache.iceberg.catalog.SupportsNamespaces
public boolean removeProperties(org.apache.iceberg.catalog.Namespace namespace, java.util.Set<java.lang.String> properties)
removeProperties
in interface org.apache.iceberg.catalog.SupportsNamespaces
public java.util.Map<java.lang.String,java.lang.String> loadNamespaceMetadata(org.apache.iceberg.catalog.Namespace namespace)
loadNamespaceMetadata
in interface org.apache.iceberg.catalog.SupportsNamespaces
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException