Skip to content

[rollup] Why the documents of the rollup contain <field>.<agg_type>._count having the same values? #47876

Closed as not planned
@lucabelluccini

Description

@lucabelluccini

Elasticsearch version: 7.4.0 (and previous)

Description of the problem including expected versus actual behavior:

The documents generated by the Rollup Job always produce, for each field considered in the terms, a field named <field>.<agg_type>._count.
The value of such field is always the same.
Why isn't it written just once at the root of the document?

Steps to reproduce:

  1. Add the demo dataset kiana_sample_data_logs
  2. Tweak the data to contain extra fields
POST kibana_sample_data_logs/_update_by_query
{
  "script": {
    "source": "ctx._source.my_field = 3991",
    "lang": "painless"
  },
  "query": {
    "term": {
      "extension": "deb"
    }
  }
}
  1. Run a rollup on my_field

Result:

        "_source" : {
          "@timestamp.date_histogram.time_zone" : "UTC",
          "my_field.max.value" : 3991.0,
          "bytes.value_count.value" : 2.0,
          "@timestamp.date_histogram._count" : 2,
          "my_field.avg.value" : 7982.0,
          "phpmemory.value_count.value" : 0.0,
          "phpmemory.sum.value" : 0.0,
          "bytes.histogram.interval" : 10,
          "my_field.avg._count" : 2.0,
          "bytes.histogram.value" : 6210.0,
          "bytes.sum.value" : 12438.0,
          "bytes.min.value" : 6219.0,
          "my_field.terms.value" : 3991,
          "_rollup.id" : "dasdsa",
          "my_field.min.value" : 3991.0,
          "response.keyword.terms.value" : "200",
          "@timestamp.date_histogram.timestamp" : 1569715200000,
          "my_field.value_count.value" : 2.0,
          "bytes.max.value" : 6219.0,
          "machine.os.keyword.terms.value" : "win 8",
          "my_field.histogram._count" : 2,
          "my_field.histogram.value" : 3990.0,
          "@timestamp.date_histogram.interval" : "60m",
          "my_field.histogram.interval" : 10,
          "bytes.avg.value" : 12438.0,
          "machine.ram.histogram.value" : 8.58993459E9,
          "bytes.avg._count" : 2.0,
          "request.keyword.terms._count" : 2,
          "request.keyword.terms.value" : "/elasticsearch/elasticsearch-6.3.2.deb",
          "my_field.terms._count" : 2,
          "my_field.sum.value" : 7982.0,
          "bytes.histogram._count" : 2,
          "_rollup.version" : 2,
          "machine.os.keyword.terms._count" : 2,
          "machine.ram.histogram._count" : 2,
          "response.keyword.terms._count" : 2,
          "machine.ram.histogram.interval" : 10
        }
      },

Metadata

Metadata

Assignees

No one assigned

    Labels

    :StorageEngine/RollupTurn fine-grained time-based data into coarser-grained dataTeam: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