Interface MetadataMapper<U,R extends org.jooq.Record>

Type Parameters:
U - Metastore component metadata type
R - RDBMS table record type
All Known Implementing Classes:
AbstractMetadataMapper, TablesMetadataMapper, TablesMetadataMapper.FileMapper, TablesMetadataMapper.PartitionMapper, TablesMetadataMapper.RowGroupMapper, TablesMetadataMapper.SegmentMapper, TablesMetadataMapper.TableMapper

public interface MetadataMapper<U,R extends org.jooq.Record>
Provides various mapping, transformation methods for the given RDBMS table and Metastore component metadata unit.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    org.jooq.Table<R>
     
    org.jooq.Condition
    Converts Metastore filter expression into JOOQ condition instance which will be used as where clause in SQL query.
    List<org.jooq.Condition>
    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.
    List<org.jooq.Field<?>>
    Matches given list of Metastore columns to the available RDBMS table columns.
    toRecord(U unit)
    Converts Metastore component metadata unit into RDBMS table record.
    toUnit(org.jooq.Record record)
    Converts RDBMS table record into Metastore component metadata unit.
  • Method Details

    • table

      org.jooq.Table<R> table()
      Returns:
      RDBMS table instance
    • emptyUnit

      U emptyUnit()
      Returns:
      Metastore component metadata unit instance with all fields set to null
    • toUnit

      U toUnit(org.jooq.Record record)
      Converts RDBMS table record into Metastore component metadata unit.
      Parameters:
      record - RDBMS table record
      Returns:
      Metastore component metadata unit instance
    • toRecord

      R toRecord(U unit)
      Converts Metastore component metadata unit into RDBMS table record.
      Parameters:
      unit - Metastore component metadata unit
      Returns:
      RDBMS table record instance
    • toFields

      List<org.jooq.Field<?>> toFields(List<MetastoreColumn> columns)
      Matches given list of Metastore columns to the available RDBMS table columns.
      Parameters:
      columns - list of Metastore columns
      Returns:
      list of RDBMS table fields
    • toCondition

      org.jooq.Condition toCondition(FilterExpression filter)
      Converts Metastore filter expression into JOOQ condition instance which will be used as where clause in SQL query.
      Parameters:
      filter - filter expression
      Returns:
      JOOQ condition instance
    • toDeleteConditions

      List<org.jooq.Condition> toDeleteConditions(List<U> 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.
      Parameters:
      units - list of Metastore component metadata units
      Returns:
      list of JOOQ condition instances