public class TableMetadataUtils extends Object
Constructor and Description |
---|
TableMetadataUtils() |
Modifier and Type | Method and Description |
---|---|
static <T> Comparator<T> |
getComparator(TypeProtos.MinorType type)
Returns
Comparator instance considering specified type . |
static <T extends Comparable<T>> |
getNaturalNullsFirstComparator()
Returns "natural order" comparator which threads nulls as min values.
|
static <T extends BaseMetadata> |
mergeColumnsStatistics(Collection<T> metadataList,
Set<SchemaPath> columns,
List<CollectableColumnStatisticsKind<?>> statisticsToCollect)
Merges list of specified metadata into the map of
ColumnStatistics with columns as keys. |
static TableMetadata |
updateRowCount(TableMetadata tableMetadata,
Collection<? extends BaseMetadata> statistics)
Updates row count and column nulls count for specified table metadata and returns new
TableMetadata instance with updated statistics. |
public static <T> Comparator<T> getComparator(TypeProtos.MinorType type)
Comparator
instance considering specified type
.type
- type of the columnComparator
instancepublic static <T extends Comparable<T>> Comparator<T> getNaturalNullsFirstComparator()
T
- type to comparepublic static <T extends BaseMetadata> Map<SchemaPath,ColumnStatistics<?>> mergeColumnsStatistics(Collection<T> metadataList, Set<SchemaPath> columns, List<CollectableColumnStatisticsKind<?>> statisticsToCollect)
ColumnStatistics
with columns as keys.T
- type of metadata to collectmetadataList
- list of metadata to be mergedcolumns
- set of columns whose statistics should be mergedstatisticsToCollect
- kinds of statistics that should be collectedpublic static TableMetadata updateRowCount(TableMetadata tableMetadata, Collection<? extends BaseMetadata> statistics)
TableMetadata
instance with updated statistics.tableMetadata
- table statistics to updatestatistics
- list of statistics whose row count should be consideredTableMetadata
instance with updated statisticsCopyright © 1970 The Apache Software Foundation. All rights reserved.