ColumnStat¶
Creating Instance¶
ColumnStat takes the following to be created:
- Distinct Count (number of distinct values)
- Minimum Value
- Maximum Value
- Null Count (number of
nullvalues) - 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:
CatalogColumnStatis requested to toPlanStatRangelogical operator is requested tocomputeStatsEstimationUtilsis requested tonullColumnStatJoinEstimationis requested to computeByNdv, computeByHistogramUnionEstimationis requested tocomputeMinMaxStats,computeNullCountStatsCommandUtilsis requested to rowToColumnStat
Converting to CatalogColumnStat¶
toCatalogColumnStat(
colName: String,
dataType: DataType): CatalogColumnStat
toCatalogColumnStat converts this ColumnStat to a CatalogColumnStat.
toCatalogColumnStat is used when:
PruneHiveTablePartitionslogical optimization is requested toupdateTableMetaAnalyzeColumnCommandlogical command is requested to analyzeColumnInCatalogPruneFileSourcePartitionslogical optimization is executed