Package org.apache.iceberg.hive
Class HiveTableOperations
- java.lang.Object
-
- org.apache.iceberg.BaseMetastoreTableOperations
-
- org.apache.iceberg.hive.HiveTableOperations
-
- All Implemented Interfaces:
TableOperations
public class HiveTableOperations extends BaseMetastoreTableOperations
TODO we should be able to extract some more commonalities to BaseMetastoreTableOperations to avoid code duplication between this class and Metacat Tables.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.iceberg.BaseMetastoreTableOperations
BaseMetastoreTableOperations.CommitStatus
-
-
Field Summary
-
Fields inherited from class org.apache.iceberg.BaseMetastoreTableOperations
ICEBERG_TABLE_TYPE_VALUE, METADATA_LOCATION_PROP, PREVIOUS_METADATA_LOCATION_PROP, TABLE_TYPE_PROP
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
HiveTableOperations(org.apache.hadoop.conf.Configuration conf, ClientPool metaClients, FileIO fileIO, java.lang.String catalogName, java.lang.String database, java.lang.String table)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doCommit(TableMetadata base, TableMetadata metadata)
protected void
doRefresh()
FileIO
io()
Returns aFileIO
to read and write table data and metadata files.protected java.lang.String
tableName()
The full name of the table used for logging purposes only.static java.lang.String
translateToIcebergProp(java.lang.String hmsProp)
Provides key translation where necessary between Iceberg and HMS props.-
Methods inherited from class org.apache.iceberg.BaseMetastoreTableOperations
checkCommitStatus, commit, current, currentMetadataLocation, currentVersion, disableRefresh, locationProvider, metadataFileLocation, refresh, refreshFromMetadataLocation, refreshFromMetadataLocation, refreshFromMetadataLocation, refreshFromMetadataLocation, requestRefresh, temp, writeNewMetadata
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.iceberg.TableOperations
encryption, newSnapshotId
-
-
-
-
Constructor Detail
-
HiveTableOperations
protected HiveTableOperations(org.apache.hadoop.conf.Configuration conf, ClientPool metaClients, FileIO fileIO, java.lang.String catalogName, java.lang.String database, java.lang.String table)
-
-
Method Detail
-
translateToIcebergProp
public static java.lang.String translateToIcebergProp(java.lang.String hmsProp)
Provides key translation where necessary between Iceberg and HMS props. This translation is needed because some properties control the same behaviour but are named differently in Iceberg and Hive. Therefore changes to these property pairs should be synchronized. Example: Deleting data files upon DROP TABLE is enabled using gc.enabled=true in Iceberg and external.table.purge=true in Hive. Hive and Iceberg users are unaware of each other's control flags, therefore inconsistent behaviour can occur from e.g. a Hive user's point of view if external.table.purge=true is set on the HMS table but gc.enabled=false is set on the Iceberg table, resulting in no data file deletion.- Parameters:
hmsProp
- The HMS property that should be translated to Iceberg property- Returns:
- Iceberg property equivalent to the hmsProp. If no such translation exists, the original hmsProp is returned
-
tableName
protected java.lang.String tableName()
Description copied from class:BaseMetastoreTableOperations
The full name of the table used for logging purposes only. For example for HiveTableOperations it is catalogName + "." + database + "." + table.- Specified by:
tableName
in classBaseMetastoreTableOperations
- Returns:
- The full name
-
io
public FileIO io()
Description copied from interface:TableOperations
Returns aFileIO
to read and write table data and metadata files.
-
doRefresh
protected void doRefresh()
- Overrides:
doRefresh
in classBaseMetastoreTableOperations
-
doCommit
protected void doCommit(TableMetadata base, TableMetadata metadata)
- Overrides:
doCommit
in classBaseMetastoreTableOperations
-
-