Interface Modify<T>
- Type Parameters:
T
- component unit type
- All Known Implementing Classes:
AbstractModify
,IcebergModify
,MongoModify
,RdbmsModify
public interface Modify<T>
Drill Metastore Modify interface contains methods to be implemented in order
to provide modify functionality in the Metastore component.
-
Method Summary
Modifier and TypeMethodDescriptionAdds delete operation for the Metastore component based on the filter expression and metadata types.void
execute()
Executes list of provided metastore operations in one transaction if Metastore implementation supports transactions, otherwise executes operations consecutively.Adds overwrite operation for the Metastore component.void
purge()
Deletes all data from the Metastore component.
-
Method Details
-
overwrite
Adds overwrite operation for the Metastore component. For Metastore Tables component, can be used to add new table data or replace partially / fully existing. For example, if one of the table segments has changed, all this segment data and table general information must be replaced with updated data. Thus provided units must include updated data, filter by which existing data will be overwritten will be determined based on given data.- Parameters:
units
- component units to be overwritten- Returns:
- current instance of Modify interface implementation
-
overwrite
-
delete
Adds delete operation for the Metastore component based on the filter expression and metadata types. For example for Metastore Tables component, if table has two segments and data for one of the segments needs to be deleted. Thus filter must be based on unique identifier of the table's top-level segment: storagePlugin = 'dfs' and workspace = 'tmp' and tableName = 'nation' and metadataKey = 'part_int=3'. Metadata types should include all metadata types present in this segment: SEGMENT, FILE, ROW_GROUP, PARTITION. If all table metadata should be deleted, ALL segment can be indicated along with unique table identifier: storagePlugin = 'dfs' and workspace = 'tmp' and tableName = 'nation'.- Parameters:
delete
- delete operation holder- Returns:
- current instance of Modify interface implementation
-
execute
void execute()Executes list of provided metastore operations in one transaction if Metastore implementation supports transactions, otherwise executes operations consecutively. All operations should be executed in the same order as they were added. -
purge
void purge()Deletes all data from the Metastore component. Note, this is terminal operation and it does not take into account any previously set delete operations or overwrite units, it just deletes all data.
-