Package org.apache.iceberg.hive
Class HiveTableOperations
java.lang.Object
org.apache.iceberg.BaseMetastoreOperations
org.apache.iceberg.BaseMetastoreTableOperations
org.apache.iceberg.hive.HiveTableOperations
- All Implemented Interfaces:
- TableOperations
TODO we should be able to extract some more commonalities to BaseMetastoreTableOperations to
 avoid code duplication between this class and Metacat Tables.
- 
Nested Class SummaryNested classes/interfaces inherited from class org.apache.iceberg.BaseMetastoreOperationsBaseMetastoreOperations.CommitStatus
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final Stringstatic final longstatic final Stringstatic final Stringstatic final StringFields inherited from class org.apache.iceberg.BaseMetastoreTableOperationsICEBERG_TABLE_TYPE_VALUE, METADATA_LOCATION_PROP, PREVIOUS_METADATA_LOCATION_PROP, TABLE_TYPE_PROP
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedHiveTableOperations(org.apache.hadoop.conf.Configuration conf, ClientPool<org.apache.hadoop.hive.metastore.IMetaStoreClient, org.apache.thrift.TException> metaClients, FileIO fileIO, String catalogName, String database, String table) 
- 
Method SummaryModifier and TypeMethodDescriptiondatabase()protected voiddoCommit(TableMetadata base, TableMetadata metadata) protected voiddefault booleanhmsEnvContext(String metadataLocation) io()Returns aFileIOto read and write table data and metadata files.default org.apache.hadoop.hive.metastore.api.TablelongClientPool<org.apache.hadoop.hive.metastore.IMetaStoreClient,org.apache.thrift.TException> default org.apache.hadoop.hive.metastore.api.TablenewHmsTable(String hmsTableOwner) default voidpersistTable(org.apache.hadoop.hive.metastore.api.Table hmsTable, boolean updateHiveTable, String metadataLocation) default voiddefault voidtable()protected StringThe full name of the table used for logging purposes only.org.apache.hadoop.hive.metastore.TableTypestatic StringtranslateToIcebergProp(String hmsProp) Provides key translation where necessary between Iceberg and HMS props.Methods inherited from class org.apache.iceberg.BaseMetastoreTableOperationscheckCommitStatus, commit, current, currentMetadataLocation, currentVersion, disableRefresh, locationProvider, metadataFileLocation, refresh, refreshFromMetadataLocation, refreshFromMetadataLocation, refreshFromMetadataLocation, refreshFromMetadataLocation, requestRefresh, temp, writeNewMetadata, writeNewMetadataIfRequiredMethods inherited from class org.apache.iceberg.BaseMetastoreOperationscheckCommitStatusMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.iceberg.TableOperationsencryption, newSnapshotId, requireStrictCleanup
- 
Field Details- 
HIVE_TABLE_PROPERTY_MAX_SIZE- See Also:
 
- 
HIVE_TABLE_PROPERTY_MAX_SIZE_DEFAULTstatic final long HIVE_TABLE_PROPERTY_MAX_SIZE_DEFAULT- See Also:
 
- 
NO_LOCK_EXPECTED_KEY- See Also:
 
- 
NO_LOCK_EXPECTED_VALUE- See Also:
 
- 
ICEBERG_VIEW_TYPE_VALUE- See Also:
 
 
- 
- 
Constructor Details- 
HiveTableOperationsprotected HiveTableOperations(org.apache.hadoop.conf.Configuration conf, ClientPool<org.apache.hadoop.hive.metastore.IMetaStoreClient, org.apache.thrift.TException> metaClients, FileIO fileIO, String catalogName, String database, String table) 
 
- 
- 
Method Details- 
translateToIcebergPropProvides 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
 
- 
tableNameDescription copied from class:BaseMetastoreTableOperationsThe full name of the table used for logging purposes only. For example for HiveTableOperations it is catalogName + "." + database + "." + table.- Specified by:
- tableNamein class- BaseMetastoreTableOperations
- Returns:
- The full name
 
- 
ioDescription copied from interface:TableOperationsReturns aFileIOto read and write table data and metadata files.- Specified by:
- ioin interface- TableOperations
 
- 
doRefreshprotected void doRefresh()- Overrides:
- doRefreshin class- BaseMetastoreTableOperations
 
- 
doCommit- Overrides:
- doCommitin class- BaseMetastoreTableOperations
 
- 
maxHiveTablePropertySizepublic long maxHiveTablePropertySize()
- 
database
- 
table
- 
tableTypepublic org.apache.hadoop.hive.metastore.TableType tableType()
- 
metaClientspublic ClientPool<org.apache.hadoop.hive.metastore.IMetaStoreClient,org.apache.thrift.TException> metaClients()
- 
loadHmsTabledefault org.apache.hadoop.hive.metastore.api.Table loadHmsTable() throws org.apache.thrift.TException, InterruptedException- Throws:
- org.apache.thrift.TException
- InterruptedException
 
- 
hmsEnvContext
- 
exposeInHmsPropertiesdefault boolean exposeInHmsProperties()
- 
setSchema
- 
setField
- 
persistTabledefault void persistTable(org.apache.hadoop.hive.metastore.api.Table hmsTable, boolean updateHiveTable, String metadataLocation) throws org.apache.thrift.TException, InterruptedException - Throws:
- org.apache.thrift.TException
- InterruptedException
 
- 
newHmsTable
 
-