Interface MetadataMapper<U,R extends org.jooq.Record>
- Type Parameters:
U- Metastore component metadata typeR- 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 TypeMethodDescriptionorg.jooq.Table<R> table()org.jooq.ConditiontoCondition(FilterExpression filter) Converts Metastore filter expression into JOOQ condition instance which will be used as where clause in SQL query.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.List<org.jooq.Field<?>> toFields(List<MetastoreColumn> columns) Matches given list of Metastore columns to the available RDBMS table columns.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
Converts RDBMS table record into Metastore component metadata unit.- Parameters:
record- RDBMS table record- Returns:
- Metastore component metadata unit instance
-
toRecord
Converts Metastore component metadata unit into RDBMS table record.- Parameters:
unit- Metastore component metadata unit- Returns:
- RDBMS table record instance
-
toFields
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
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
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
-