Record Class ColumnStatTypeSupport
java.lang.Object
java.lang.Record
org.elasticsearch.xpack.esql.datasources.ColumnStatTypeSupport
public record ColumnStatTypeSupport(ColumnStatTypeSupport.StatBlockKind blockKind, boolean harvestable, ColumnStatTypeSupport.StatCoercion coercion)
extends Record
The single source of truth for how a column's ESQL
DataType participates in the external-source
per-column statistics pipeline (harvest, cache classification, warm-path serving, and block construction).
Five DataType-keyed switches used to encode this mapping independently and drifted against one another;
they now all dispatch on of(DataType).
Three orthogonal facts per type:
blockKind— the block flavour a served MIN/MAX extremum is materialized into.nullmeans the type is NOT servable (nobuildBlockarm exists);servable()is exactlyblockKind != null.harvestable— whether the cold-scanColumnStatsAccumulatortracks min/max for this type (i.e. the type is "text-pushable"). Text-format warm stats exist for a column ONLY if the accumulator harvested them, so a non-harvestable type can never produce a warm extremum even though it may still be servable (see the WARNING below).coercion— how a statNumberis normalized to the column's resolved type before it is folded/served.
WARNING — the three flags are ORTHOGONAL; do not derive one from another. They carry genuinely independent facts:
- The counters (
COUNTER_LONG/COUNTER_DOUBLE) ARE servable (they carry ablockKind) yet are NOT coercible (coercion == NONE) and NOT harvestable — so servability implies neither coercibility nor harvestability. UNSIGNED_LONGis servable (blockKind == LONG: Parquet sign-flip-encodes its stat into ESQL's wire form viaParquetColumnDecoding#encodeUnsignedLong, exactly as the scan does, so the LONG arm serves the encoded value verbatim — byte-identical to the scan) AND coercible (coercion == EXACT_LONG, which still neutralizes a stale committed extremum that cannot be represented in the resolved type) yet NOT harvestable (the text accumulator never tracks it).
UNSIGNED_LONG depends on.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe block flavour a served MIN/MAX extremum is materialized into.static enumHow a statNumberis normalized to the column's resolved type before it is folded/served. -
Constructor Summary
ConstructorsConstructorDescriptionColumnStatTypeSupport(ColumnStatTypeSupport.StatBlockKind blockKind, boolean harvestable, ColumnStatTypeSupport.StatCoercion coercion) Creates an instance of aColumnStatTypeSupportrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theblockKindrecord component.coercion()Returns the value of thecoercionrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanReturns the value of theharvestablerecord component.final inthashCode()Returns a hash code value for this object.static ColumnStatTypeSupportThe support record fortype, ornullif the type does not participate in the external-source per-column statistics pipeline at all (neither servable, harvestable, nor coercible).booleanservable()True iff a served MIN/MAX extremum can be materialized into a block for this type (i.e.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ColumnStatTypeSupport
public ColumnStatTypeSupport(@Nullable ColumnStatTypeSupport.StatBlockKind blockKind, boolean harvestable, ColumnStatTypeSupport.StatCoercion coercion) Creates an instance of aColumnStatTypeSupportrecord class.- Parameters:
blockKind- the value for theblockKindrecord componentharvestable- the value for theharvestablerecord componentcoercion- the value for thecoercionrecord component
-
-
Method Details
-
servable
public boolean servable()True iff a served MIN/MAX extremum can be materialized into a block for this type (i.e.blockKind != null). -
of
The support record fortype, ornullif the type does not participate in the external-source per-column statistics pipeline at all (neither servable, harvestable, nor coercible). -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
blockKind
Returns the value of theblockKindrecord component.- Returns:
- the value of the
blockKindrecord component
-
harvestable
public boolean harvestable()Returns the value of theharvestablerecord component.- Returns:
- the value of the
harvestablerecord component
-
coercion
Returns the value of thecoercionrecord component.- Returns:
- the value of the
coercionrecord component
-