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
Modifier and TypeClassDescriptionstatic class
TablesMetadataMapper
implementation forTables.FILES
table.static class
TablesMetadataMapper
implementation forTables.PARTITIONS
table.static class
TablesMetadataMapper
implementation forTables.ROW_GROUPS
table.static class
TablesMetadataMapper
implementation forTables.SEGMENTS
table.static class
TablesMetadataMapper
implementation forTables.TABLES
table. -
Field Summary
Modifier and TypeFieldDescriptionprotected static final Function<TableMetadataUnit,
List<String>> protected static final Function<TableMetadataUnit,
List<String>> -
Constructor Summary
-
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, toFields
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:MetadataMapper
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.- 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
-