Class TablesMetadataMapper<R extends org.jooq.Record>
java.lang.Object
org.apache.drill.metastore.rdbms.transform.AbstractMetadataMapper<TableMetadataUnit,R>
org.apache.drill.metastore.rdbms.components.tables.TablesMetadataMapper<R>
- Type Parameters:
R- RDBMS table record type
- All Implemented Interfaces:
MetadataMapper<TableMetadataUnit,R>
- Direct Known Subclasses:
TablesMetadataMapper.FileMapper,TablesMetadataMapper.PartitionMapper,TablesMetadataMapper.RowGroupMapper,TablesMetadataMapper.SegmentMapper,TablesMetadataMapper.TableMapper
public abstract class TablesMetadataMapper<R extends org.jooq.Record>
extends AbstractMetadataMapper<TableMetadataUnit,R>
Abstract implementation of
AbstractMetadataMapper for RDBMS Metastore tables component.
Contains common code for specific RDBMS Metastore tables component tables.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classTablesMetadataMapperimplementation forTables.FILEStable.static classTablesMetadataMapperimplementation forTables.PARTITIONStable.static classTablesMetadataMapperimplementation forTables.ROW_GROUPStable.static classTablesMetadataMapperimplementation forTables.SEGMENTStable.static classTablesMetadataMapperimplementation forTables.TABLEStable. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Function<TableMetadataUnit, List<String>> protected static final Function<TableMetadataUnit, List<String>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Function<TableMetadataUnit, List<String>> protected abstract List<org.jooq.Condition> toConditions(List<String> values) Creates JOOQ conditions based on given list of partition values.List<org.jooq.Condition> toDeleteConditions(List<TableMetadataUnit> units) Since data in Metastore is deleted by partition, extracts partitions values from given list of Metastore component metadata units and creates list of delete conditions based on them.Methods inherited from class org.apache.drill.metastore.rdbms.transform.AbstractMetadataMapper
fieldMapper, filterVisitor, toCondition, toFieldsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.drill.metastore.rdbms.transform.MetadataMapper
table, toRecord, toUnit
-
Field Details
-
TABLE_PARTITION_KEY
-
COMPONENT_PARTITION_KEY
-
-
Constructor Details
-
TablesMetadataMapper
public TablesMetadataMapper()
-
-
Method Details
-
emptyUnit
- Returns:
- Metastore component metadata unit instance with all fields set to null
-
toDeleteConditions
Description copied from interface:MetadataMapperSince data in Metastore is deleted by partition, extracts partitions values from given list of Metastore component metadata units and creates list of delete conditions based on them.- Parameters:
units- list of Metastore component metadata units- Returns:
- list of JOOQ condition instances
-
partitionKey
- Returns:
- function to determine partition key for specific table
-
toConditions
Creates JOOQ conditions based on given list of partition values. Matching is order based.- Parameters:
values- partition values- Returns:
- list of JOOQ conditions
-