Class BaseMetadata
java.lang.Object
org.apache.drill.metastore.metadata.BaseMetadata
- All Implemented Interfaces:
Metadata
- Direct Known Subclasses:
BaseTableMetadata
,FileMetadata
,PartitionMetadata
,RowGroupMetadata
,SegmentMetadata
Common provider of tuple schema, column metadata, and statistics for table, partition, file or row group.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
-
Field Summary
Modifier and TypeFieldDescriptionprotected final Map<SchemaPath,
ColumnStatistics<?>> protected final long
protected final MetadataInfo
protected final Map<String,
StatisticsHolder<?>> protected final TupleMetadata
protected final TableInfo
static final long
-
Constructor Summary
ModifierConstructorDescriptionprotected
BaseMetadata
(BaseMetadata.BaseMetadataBuilder<T> builder) -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsExactStatistics
(StatisticsKind<?> statisticsKind) Checks whether specified statistics kind is set in this non-column statistics and it corresponds to the exact statistics value.boolean
getColumn
(SchemaPath name) Returns metadata description for the specified columnReturns statistics stored in current metadata represented as Map of columnSchemaPath
s and correspondingColumnStatistics
.getColumnStatistics
(SchemaPath columnName) Returns statistics for specified column stored in current metadata.long
Allows to check the time, when any files were modified.Returns schema stored in current metadata represented asTupleMetadata
.<V> V
getStatistic
(StatisticsKind<V> statisticsKind) Returns value of non-column statistics which corresponds to specifiedStatisticsKind
.<V> V
getStatisticsForColumn
(SchemaPath columnName, StatisticsKind<V> statisticsKind) Returns value of column statistics which corresponds to specifiedStatisticsKind
for column with specifiedcolumnName
.int
hashCode()
protected abstract BaseMetadata.BaseMetadataBuilder<?>
ConvertsMetadata
implementation intoTableMetadataUnit
instance which will be used to write data into Drill Metastore Tables.protected abstract void
-
Field Details
-
UNDEFINED_TIME
public static final long UNDEFINED_TIME- See Also:
-
tableInfo
-
metadataInfo
-
schema
-
columnsStatistics
-
metadataStatistics
-
lastModifiedTime
protected final long lastModifiedTime
-
-
Constructor Details
-
BaseMetadata
-
-
Method Details
-
getColumnsStatistics
Description copied from interface:Metadata
Returns statistics stored in current metadata represented as Map of columnSchemaPath
s and correspondingColumnStatistics
.- Specified by:
getColumnsStatistics
in interfaceMetadata
- Returns:
- statistics stored in current metadata
-
getColumnStatistics
Description copied from interface:Metadata
Returns statistics for specified column stored in current metadata.- Specified by:
getColumnStatistics
in interfaceMetadata
- Parameters:
columnName
- column whose statistics should be returned- Returns:
- statistics for specified column
-
getSchema
Description copied from interface:Metadata
Returns schema stored in current metadata represented asTupleMetadata
. -
getStatistic
Description copied from interface:Metadata
Returns value of non-column statistics which corresponds to specifiedStatisticsKind
.- Specified by:
getStatistic
in interfaceMetadata
- Parameters:
statisticsKind
- statistics kind whose value should be returned- Returns:
- value of non-column statistics
-
containsExactStatistics
Description copied from interface:Metadata
Checks whether specified statistics kind is set in this non-column statistics and it corresponds to the exact statistics value.- Specified by:
containsExactStatistics
in interfaceMetadata
- Parameters:
statisticsKind
- statistics kind to check- Returns:
- true if value which corresponds to the specified statistics kind is exact
-
getStatisticsForColumn
Description copied from interface:Metadata
Returns value of column statistics which corresponds to specifiedStatisticsKind
for column with specifiedcolumnName
.- Specified by:
getStatisticsForColumn
in interfaceMetadata
- Parameters:
columnName
- name of the columnstatisticsKind
- statistics kind whose value should be returned- Returns:
- value of column statistics
-
getColumn
Description copied from interface:Metadata
Returns metadata description for the specified column- Specified by:
getColumn
in interfaceMetadata
- Parameters:
name
- column name, whose metadata type info should be returned- Returns:
ColumnMetadata
schema description of the column
-
getTableInfo
- Specified by:
getTableInfo
in interfaceMetadata
-
getMetadataInfo
- Specified by:
getMetadataInfo
in interfaceMetadata
-
getLastModifiedTime
public long getLastModifiedTime()Allows to check the time, when any files were modified. It is in Unix Timestamp, unit of measurement is millisecond. Undefined time value will be indicated usingUNDEFINED_TIME
value.- Returns:
- last modified time of files
-
equals
-
hashCode
public int hashCode() -
toMetadataUnit
Description copied from interface:Metadata
ConvertsMetadata
implementation intoTableMetadataUnit
instance which will be used to write data into Drill Metastore Tables.- Specified by:
toMetadataUnit
in interfaceMetadata
- Returns:
- metadata unit instance
-
toMetadataUnitBuilder
-
toBuilder
-