Interface SplitStats
- All Known Implementing Classes:
MergedSplitStats,SplitStats
SplitStats for
individual file splits and by MergedSplitStats
for composite splits that aggregate statistics lazily from their children.
Unknown numeric values are represented as -1; unknown object values as null.
This matches the sentinel convention used throughout the datasources layer
(see ExternalSplit.estimatedSizeInBytes()).
-
Method Summary
Modifier and TypeMethodDescriptionMaximum value for the named column, ornullif unknown or the column is not present in this split's statistics.Minimum value for the named column, ornullif unknown or the column is not present in this split's statistics.longcolumnNullCount(String name) Number of null values in the named column under the "implicit nulls" contract: a column that is physically absent from this split contributesrowCount()implicit nulls (every row would deserialize asnull).default longcolumnSizeBytes(String name) Uncompressed size in bytes for the named column, or-1if unknown or the column is not present in this split's statistics.default longcolumnValueCount(String name) Number of non-null values in the named column (multivalue-aware: a multivalued cell contributes one per value).default longOn-disk (compressed) size of this split, in bytes.default booleanWhether the named column carries any per-column statistics in this split (a null count, a min/max, or a size).longrowCount()Total row count for this split.longUncompressed size of the data in this split, in bytes.
-
Method Details
-
rowCount
long rowCount()Total row count for this split. Always>= 0. -
sizeInBytes
long sizeInBytes()Uncompressed size of the data in this split, in bytes. Returns-1if unknown. -
compressedSizeInBytes
default long compressedSizeInBytes()On-disk (compressed) size of this split, in bytes. Returns-1if unknown. -
columnNullCount
Number of null values in the named column under the "implicit nulls" contract: a column that is physically absent from this split contributesrowCount()implicit nulls (every row would deserialize asnull). Returns-1only when the column is physically present in the split but the reader could not extract a null count (the rare Parquet present-but-stats-less case; ORC always emits one).This contract makes
Count(col) = rowCount - columnNullCountcorrect for UNION_BY_NAME pushdown across files where some files lack the column, and letsIS NULL/IS NOT NULLclassifiers treat absent-column splits as unconditionally null without needing a separate "column present?" probe.Producer contract: implementations must mark a column as physically present by carrying at least one column-family stat (e.g.
size_bytes, a min/max value, or a null count). Both Parquet and ORC readers satisfy this — Parquet always emitssize_bytesand ORC always emitsnull_count. Producers that build stats by hand must follow the same rule, otherwise this method will silently report a present column as absent and inflate the implicit-null contribution. -
columnValueCount
Number of non-null values in the named column (multivalue-aware: a multivalued cell contributes one per value). This is whatCOUNT(col)returns, served directly rather than derived fromrowCount - columnNullCount(which under-counts multivalued columns).Returns
-1when not available; the caller then falls back torowCount - nullCount. -
hasColumn
Whether the named column carries any per-column statistics in this split (a null count, a min/max, or a size). This is the "column was observed by the stats layer" predicate, distinct fromcolumnNullCount(java.lang.String)'s implicit-nulls contract: for footer formats an absent column is genuinely all-null andcolumnNullCountreturnsrowCount, but a text-format partial harvest can leave a physically present column with no stats at all, and the two cases are indistinguishable throughcolumnNullCountalone. Callers that must not apply the implicit-nulls contract for unharvested columns (seeAggregatePushdownSupport.appliesImplicitNullsForAbsentColumn()) use this to safe-miss instead.Defaults to
false(conservative — "no per-column stats observed"). Footer-format implementations never consult it (they declareappliesImplicitNullsForAbsentColumn), so they need not override it; partial-harvest text formats override it with the real predicate. -
columnMin
Minimum value for the named column, ornullif unknown or the column is not present in this split's statistics. -
columnMax
Maximum value for the named column, ornullif unknown or the column is not present in this split's statistics. -
columnSizeBytes
Uncompressed size in bytes for the named column, or-1if unknown or the column is not present in this split's statistics.
-