Bug when aggregating histogram fields

Hello,

I encounter an issue with some particular values using histogram aggregations:

Here's a reproducer:

PUT test-index
{
  "mappings" : {
    "properties" : {
      "my_histogram" : {
        "type" : "histogram"
      }
    }
  }
}

PUT test-index/_doc/1
{
  "my_histogram": {
    "counts": [
      2100000000,
      300000000
    ],
    "values": [
      1000,
      2000
    ]
  }
}

GET test-index/_search
{
  "aggs": {
    "wt_96th_percentile": {
      "percentiles": {
        "field": "my_histogram",
        "percents": [
          "96.0"
        ]
      }
    }
  }
}

Here's the result I got:

{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_state_exception",
        "reason" : "Negative longs unsupported, use writeLong or writeZLong for negative numbers [-1894967296]"
      }
    ],
    "type" : "search_phase_execution_exception",
    "reason" : "all shards failed",
    "phase" : "query",
    "grouped" : true,
    "failed_shards" : [
      {
        "shard" : 0,
        "index" : "test-index",
        "node" : "EJmqZRg-RWy1WYbItsbmHQ",
        "reason" : {
          "type" : "illegal_state_exception",
          "reason" : "Negative longs unsupported, use writeLong or writeZLong for negative numbers [-1894967296]"
        }
      }
    ],
    "caused_by" : {
      "type" : "illegal_state_exception",
      "reason" : "Negative longs unsupported, use writeLong or writeZLong for negative numbers [-1894967296]",
      "caused_by" : {
        "type" : "illegal_state_exception",
        "reason" : "Negative longs unsupported, use writeLong or writeZLong for negative numbers [-1894967296]"
      }
    }
  },
  "status" : 500
}

Is it a bug? Should I report it on the GitHub repo?

Thanks,
Romain

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