# When will a CardinalityAggregationBuilder Aggregation type be supported in Rollup?

**URL:** https://discuss.elastic.co/t/when-will-a-cardinalityaggregationbuilder-aggregation-type-be-supported-in-rollup/146098
**Category:** Elasticsearch
**Created:** [August 27, 2018, 3:02am UTC](https://discuss.elastic.co/t/when-will-a-cardinalityaggregationbuilder-aggregation-type-be-supported-in-rollup/146098 "2018-08-27T03:02:03Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Paul\_Ainslie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paul_ainslie/32/55031_2.png) [@Paul\_Ainslie](https://discuss.elastic.co/u/Paul_Ainslie)
#### Post date: [August 27, 2018, 3:02am UTC](https://discuss.elastic.co/t/when-will-a-cardinalityaggregationbuilder-aggregation-type-be-supported-in-rollup/146098/1 "2018-08-27T03:02:03Z")

</div>

Any idea when CardinalityAggregationBuilder will be supported in Rollups? This query doesn't work against a rolled up index.

**Query:**

```auto
{
  "size": 0,
  "query": {
    "bool": {
      "must": [
        {
          "range": {
            "@timestamp": {
              "gte": "2018-03-01",
              "lte": "2018-03-10T23:59:59.999Z"
            }
          }
        },
        { "term": { "account": "27937601" } }
      ]
    }
  },
  "aggs": {
    "total_bytes": { "sum": { "field": "bytes" } },
    "streams": {
      "terms": {
        "field": "stream",
        "order": { "bytes_sum": "desc" },
        "size": 20
      },
      "aggs": {
        "bytes_sum": { "sum": { "field": "bytes" } },
        "distinct_ips": { "cardinality": { "field": "clientip_n_agent" } }
      }
    }
  }
}

```

**Error:**

```auto
{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "Unable to translate aggregation tree into Rollup. Aggregation [distinct_ips] is of type [CardinalityAggregationBuilder] which is currently unsupported."
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "Unable to translate aggregation tree into Rollup. Aggregation [distinct_ips] is of type [CardinalityAggregationBuilder] which is currently unsupported."
  },
  "status": 400
}

```

---

<div class="post-metadata">

### Author: ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)
#### Post date: [August 28, 2018, 3:32pm UTC](https://discuss.elastic.co/t/when-will-a-cardinalityaggregationbuilder-aggregation-type-be-supported-in-rollup/146098/2 "2018-08-28T15:32:37Z")

</div>

Unsure, there are some technical challenges which make it a longer project to support than other metrics. I'll be meaning to open a ticket to track progress on Cardinality/Percentiles... will update the thread in a little bit with a link to the issue.

We definitely want to support it (e.g. it's on the roadmap), but we're not sure when it will be implemented.

---

<div class="post-metadata">

### Author: ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)
#### Post date: [August 28, 2018, 5:02pm UTC](https://discuss.elastic.co/t/when-will-a-cardinalityaggregationbuilder-aggregation-type-be-supported-in-rollup/146098/3 "2018-08-28T17:02:51Z")

</div>

Just made an issue to track this: [https://github.com/elastic/elasticsearch/issues/33214](https://github.com/elastic/elasticsearch/issues/33214)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [September 25, 2018, 5:05pm UTC](https://discuss.elastic.co/t/when-will-a-cardinalityaggregationbuilder-aggregation-type-be-supported-in-rollup/146098/4 "2018-09-25T17:05:36Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
