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.
  • Field Details

  • Constructor Details

    • TablesMetadataMapper

      public TablesMetadataMapper()
  • Method Details

    • emptyUnit

      public TableMetadataUnit emptyUnit()
      Returns:
      Metastore component metadata unit instance with all fields set to null
    • toDeleteConditions

      public List<org.jooq.Condition> toDeleteConditions(List<TableMetadataUnit> units)
      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

      protected abstract Function<TableMetadataUnit,List<String>> partitionKey()
      Returns:
      function to determine partition key for specific table
    • toConditions

      protected abstract List<org.jooq.Condition> toConditions(List<String> values)
      Creates JOOQ conditions based on given list of partition values. Matching is order based.
      Parameters:
      values - partition values
      Returns:
      list of JOOQ conditions