# Secondary rollup of existing rollup index

**URL:** <https://discuss.elastic.co/t/secondary-rollup-of-existing-rollup-index/281706>\
**Category:** Elasticsearch\
**Tags:** rollups\
**Created:** [August 17, 2021, 2:51pm UTC](https://discuss.elastic.co/t/secondary-rollup-of-existing-rollup-index/281706 "2021-08-17T14:51:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pavan\_v](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pavan_v/32/93286_2.png) [@pavan\_v](https://discuss.elastic.co/u/pavan_v)\
**Post date:** [August 17, 2021, 2:51pm UTC](https://discuss.elastic.co/t/secondary-rollup-of-existing-rollup-index/281706/1 "2021-08-17T14:51:24Z")

</div>

Hi,  
I have an index which is created from a Rollup job. Its content is as follows:

```auto
"hits": {
    "total": 4,
    "max_score": 1,
    "hits": [
      {
        "_index": "my_rollup_1m_2021.08.17",
        "_type": "_doc",
        "_id": "my_rollup_1m$09-UpSrS0X2Nnx3TyDfMtg",
        "_score": 1,
        "_source": {
          "stId.terms._count": 2,
          "timestamp.date_histogram.time_zone": "UTC",
          "timestamp.date_histogram.timestamp": 1629201600000,
          "count.sum.value": 20,
          "_rollup.version": 2,
          "stId.terms.value": 1,
          "timestamp.date_histogram.interval": "1h",
          "timestamp.date_histogram._count": 2,
          "_rollup.id": "my_rollup_1m"
        }
      },
    ....
}

```

Then I am trying to create a secondary level rollup job, that rolls up the index mentioned above. The secondary rollup job configuration is:

```auto
PUT _rollup/job/my_rollup_1h
{
  "id": "my_rollup_1h",
  "index_pattern": "my_rollup_1m_2021.08.17",
  "rollup_index": "<my_rollup_1h_{now/d}>",
  "cron": "0 39 * * * ?",
  "groups": {
    "date_histogram": {
      "interval": "1h",
      "field": "timestamp.date_histogram.timestamp",
      "time_zone": "UTC"
    },
    "terms": {
      "fields": [
        "stId.terms.value"
      ]
    }
  },
  "metrics": [
    {
      "field": "count.sum.value",
      "metrics": [
        "sum"
      ]
    }
  ],
  "timeout": "20s",
  "page_size": 10000
}

```

Secondary rollup job runs fine as seen from below status:

```auto
"status": {
    "job_state": "started",
    "current_position": {
      "st.terms.value.terms": 4,
      "timestamp.date_histogram.timestamp.date_histogram": 1629201600000
    },
    "upgraded_doc_id": true
  },
  "stats": {
    "pages_processed": 2,
    "documents_processed": 4,
    "rollups_indexed": 4,
    "trigger_count": 1,
    "index_time_in_ms": 1,
    "index_total": 1,
    "index_failures": 0,
    "search_time_in_ms": 5,
    "search_total": 2,
    "search_failures": 0
  }

```

But when i check the seconday rollup index, its always empty. Besides i see this exception in ES:

```auto
[2021-08-17T13:39:00,004][WARN][o.e.x.c.i.AsyncTwoPhaseIndexer] [es-data-0] Error while attempting to bulk index documents: failure in bulk execution:
[0]: index [my_rollup_1h_2021.08.17], type [_doc], id [my_rollup_1h$2b4OsNouZ94vhB47tII2ww], message [MapperParsingException[failed to parse]; nested: ClassCastException[org.elasticsearch.index.mapper.DateFieldMapper incompatible with org.elasticsearch.index.mapper.ObjectMapper];]
[1]: index [my_rollup_1h_2021.08.17], type [_doc], id [my_rollup_1h$AU3POF2c3SwXnjzgga3d0g], message [MapperParsingException[failed to parse]; nested: ClassCastException[org.elasticsearch.index.mapper.DateFieldMapper incompatible with org.elasticsearch.index.mapper.ObjectMapper];]
[2]: index [my_rollup_1h_2021.08.17], type [_doc], id [my_rollup_1h$pQOaK-fGV4vl35xgviD4Og], message [MapperParsingException[failed to parse]; nested: ClassCastException[org.elasticsearch.index.mapper.DateFieldMapper incompatible with org.elasticsearch.index.mapper.ObjectMapper];]
[3]: index [my_rollup_1h_2021.08.17], type [_doc], id [my_rollup_1h$72Ci96Cz6XIVIoTHg3z-Rw], message [MapperParsingException[failed to parse]; nested: ClassCastException[org.elasticsearch.index.mapper.DateFieldMapper incompatible with org.elasticsearch.index.mapper.ObjectMapper];]

```

Seems like mapping exception when trying to index the processed data. Is there any thing else to be done when configuring the job in this scenario?

---

<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 14, 2021, 2:51pm UTC](https://discuss.elastic.co/t/secondary-rollup-of-existing-rollup-index/281706/2 "2021-09-14T14:51:50Z")

</div>

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