ColumnStat¶
Creating Instance¶
ColumnStat
takes the following to be created:
- Distinct Count (number of distinct values)
- Minimum Value
- Maximum Value
- Null Count (number of
null
values) - Average length of the values (for fixed-length types, this should be a constant)
- Maximum length of the values (for fixed-length types, this should be a constant)
-
Histogram
- 2
ColumnStat
is created when:
CatalogColumnStat
is requested to toPlanStatRange
logical operator is requested tocomputeStats
EstimationUtils
is requested tonullColumnStat
JoinEstimation
is requested to computeByNdv, computeByHistogramUnionEstimation
is requested tocomputeMinMaxStats
,computeNullCountStats
CommandUtils
is requested to rowToColumnStat
Converting to CatalogColumnStat¶
toCatalogColumnStat(
colName: String,
dataType: DataType): CatalogColumnStat
toCatalogColumnStat
converts this ColumnStat
to a CatalogColumnStat.
toCatalogColumnStat
is used when:
PruneHiveTablePartitions
logical optimization is requested toupdateTableMeta
AnalyzeColumnCommand
logical command is requested to analyzeColumnInCatalogPruneFileSourcePartitions
logical optimization is executed