Skip to content

Composite aggs should support missing #60043

@hendrikmuhs

Description

@hendrikmuhs

Composite aggs allows the user to specify "missing_bucket":true which has been implemented for rollup to handle sparse data.

For transform it would be good to support missing in addition, see #48243

Comparison missing_bucket and missing

missing_bucket

  • maps non-existing fields to a bucket with key null
  • its not possible to collapse the bucket into the bucket of the same value, e.g. if you want a default

missing

  • maps non-existing fields to a bucket with a given key, key must not be null
    • the key can clash on purpose with an existing bucket, so you can collapse buckets, e.g. "missing":0 in a histogram
  • allowing "missing": null would be possible as it is valid json, however for high-level clients this is problematic as some default to remove the whole entry if the value is null, therefore it's better to keep disallow null and handle this specific case with "missing_bucket":true

Solution

Composite aggs should support missing(+ it would be good if aggregations support missing_bucket for feature parity).

From a user perspective the 2 parameters might cause some confusion, because it's not clear whether you have to set missing_bucket to true if you set missing. Therefore it seems best to ignore missing_bucket if missing is set or make both parameters mutually exclusive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    >enhancementTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions