Modifier and Type | Field and Description |
---|---|
static java.lang.String |
LOCK_PROPERTY_PREFIX |
Constructor and Description |
---|
HadoopTables() |
HadoopTables(org.apache.hadoop.conf.Configuration conf) |
Modifier and Type | Method and Description |
---|---|
Catalog.TableBuilder |
buildTable(java.lang.String location,
Schema schema) |
Table |
create(Schema schema,
PartitionSpec spec,
SortOrder order,
java.util.Map<java.lang.String,java.lang.String> properties,
java.lang.String location)
Create a table using the FileSystem implementation resolve from
location.
|
boolean |
dropTable(java.lang.String location)
Drop a table and delete all data and metadata files.
|
boolean |
dropTable(java.lang.String location,
boolean purge)
Drop a table; optionally delete data and metadata files.
|
boolean |
exists(java.lang.String location) |
org.apache.hadoop.conf.Configuration |
getConf() |
Table |
load(java.lang.String location)
Loads the table location from a FileSystem path location.
|
Transaction |
newCreateTableTransaction(java.lang.String location,
Schema schema,
PartitionSpec spec,
java.util.Map<java.lang.String,java.lang.String> properties)
Start a transaction to create a table.
|
Transaction |
newReplaceTableTransaction(java.lang.String location,
Schema schema,
PartitionSpec spec,
java.util.Map<java.lang.String,java.lang.String> properties,
boolean orCreate)
Start a transaction to replace a table.
|
void |
setConf(org.apache.hadoop.conf.Configuration conf) |
public static final java.lang.String LOCK_PROPERTY_PREFIX
public HadoopTables()
public HadoopTables(org.apache.hadoop.conf.Configuration conf)
public Table load(java.lang.String location)
public Table create(Schema schema, PartitionSpec spec, SortOrder order, java.util.Map<java.lang.String,java.lang.String> properties, java.lang.String location)
create
in interface Tables
schema
- iceberg schema used to create the tablespec
- partitioning spec, if null the table will be unpartitionedproperties
- a string map of table properties, initialized to empty if nulllocation
- a path URI (e.g. hdfs:///warehouse/my_table)public boolean dropTable(java.lang.String location)
location
- a path URI (e.g. hdfs:///warehouse/my_table)public boolean dropTable(java.lang.String location, boolean purge)
If purge is set to true the implementation should delete all data and metadata files.
location
- a path URI (e.g. hdfs:///warehouse/my_table)purge
- if true, delete all data and metadata files in the tablepublic Transaction newCreateTableTransaction(java.lang.String location, Schema schema, PartitionSpec spec, java.util.Map<java.lang.String,java.lang.String> properties)
location
- a location for the tableschema
- a schemaspec
- a partition specproperties
- a string map of table propertiesTransaction
to create the tableAlreadyExistsException
- if the table already existspublic Transaction newReplaceTableTransaction(java.lang.String location, Schema schema, PartitionSpec spec, java.util.Map<java.lang.String,java.lang.String> properties, boolean orCreate)
location
- a location for the tableschema
- a schemaspec
- a partition specproperties
- a string map of table propertiesorCreate
- whether to create the table if not existsTransaction
to replace the tableNoSuchTableException
- if the table doesn't exist and orCreate is falsepublic Catalog.TableBuilder buildTable(java.lang.String location, Schema schema)
public void setConf(org.apache.hadoop.conf.Configuration conf)
setConf
in interface org.apache.hadoop.conf.Configurable
public org.apache.hadoop.conf.Configuration getConf()
getConf
in interface org.apache.hadoop.conf.Configurable