Interface SourceStatistics.ColumnStatistics

Enclosing interface:
SourceStatistics

public static interface SourceStatistics.ColumnStatistics
Statistics for an individual column.

Contract for minValue()/maxValue(): the values must already be in ESQL's in-memory representation for the column's data type — i.e. exactly what a scan of the same column would produce. In particular temporal columns must be normalized (e.g. DATETIME as epoch-milliseconds, not raw parquet days/micros), because PushStatsToExternalSource substitutes these values directly into MIN/MAX aggregations without any further conversion. A format reader that cannot produce a scan-equivalent value for a column (e.g. statistics that are not ordered by the column's logical type) must omit min/max for that column (Optional.empty()) so the query falls back to a scan.

  • Method Details

    • nullCount

      OptionalLong nullCount()
      Returns the number of null values in this column, if known.
    • valueCount

      default OptionalLong valueCount()
      Returns the number of non-null values in this column, if known. Multivalue-aware: a multivalued cell contributes one per value, so this is what COUNT(col) returns and is served directly instead of being derived from rowCount - nullCount (which under-counts multivalued columns).
    • distinctCount

      OptionalLong distinctCount()
      Returns the number of distinct values in this column, if known.
    • minValue

      Optional<Object> minValue()
      Returns the minimum value as a comparable object, if known. The type and representation must match ESQL's in-memory form for the column's data type (see the interface contract).
    • maxValue

      Optional<Object> maxValue()
      Returns the maximum value as a comparable object, if known. The type and representation must match ESQL's in-memory form for the column's data type (see the interface contract).
    • sizeInBytes

      default OptionalLong sizeInBytes()
      Returns the uncompressed size of this column in bytes, if known. Useful for cost-based filter evaluation ordering.