Histogram aggregation with float interval < 1.0 gives ArithmeticException

Hi, the following query (note bolded line):

{
"query": {
"filtered": {
"query": {
"term": {
"self_and_ancestors": "diamonds"
}
},
"filter": {
"terms": {
"attr_types.diamond#color": [
"0000d"
]
}
}
}
},
"sort": [
{
"sell_offer_cents": {
"order": "asc"
}
}
],
"fields": "_source",
"script_fields": {
"gap_cents": {
"script": "custom_score_item_bid_ask_gap",
"params": {
"individual_price_item_ids": [],
"individual_price_item_cents": [],
"pb_amount_below_cents": 0
},
"lang": "native"
}
},
"aggs": {
"all_items": {
"global": {},
"aggs": {
"gem#carats": {
"filter": {
"terms": {
"attr_types.diamond#polish": [
"0000ex",
"0001vg"
]
}
},
"aggs": {
"gems#carats": {
"histogram": {
"field": "attr_types.gem#carats",
* "interval": 0.1,*
"min_doc_count": 0
}
},
"gem#carats_stats": {
"stats": {
"field": "attr_types.gem#carats"
}
}
}
}
}
}
}
}

Gives the following error:

{
"error": "SearchPhaseExecutionException[Failed to execute phase [query],
all shards failed; shardFailures
{[D6h8GKwjRqO_Yem09Hu_VA][development-liquidibles::application-items][4]:
QueryPhaseExecutionException[[development-liquidibles::application-items][4]:
query[filtered(filtered(self_and_ancestors:diamonds)->cache(attr_types.diamond#color:0000d))->cache(_type:item)],from[0],size[10],sort[<custom:"sell_offer_cents":
org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@11ce49a>]:
Query Failed [Failed to execute global aggregators]]; nested:
ArithmeticException;
}{[D6h8GKwjRqO_Yem09Hu_VA][development-liquidibles::application-items][3]:
QueryPhaseExecutionException[[development-liquidibles::application-items][3]:
query[filtered(filtered(self_and_ancestors:diamonds)->cache(attr_types.diamond#color:0000d))->cache(_type:item)],from[0],size[10],sort[<custom:"sell_offer_cents":
org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@8c9d82>]:
Query Failed [Failed to execute global aggregators]]; nested:
ArithmeticException;
}{[D6h8GKwjRqO_Yem09Hu_VA][development-liquidibles::application-items][2]:
QueryPhaseExecutionException[[development-liquidibles::application-items][2]:
query[filtered(filtered(self_and_ancestors:diamonds)->cache(attr_types.diamond#color:0000d))->cache(_type:item)],from[0],size[10],sort[<custom:"sell_offer_cents":
org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@73a7e5>]:
Query Failed [Failed to execute global aggregators]]; nested:
ArithmeticException;
}{[D6h8GKwjRqO_Yem09Hu_VA][development-liquidibles::application-items][1]:
QueryPhaseExecutionException[[development-liquidibles::application-items][1]:
query[filtered(filtered(self_and_ancestors:diamonds)->cache(attr_types.diamond#color:0000d))->cache(_type:item)],from[0],size[10],sort[<custom:"sell_offer_cents":
org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@15d1b1a>]:
Query Failed [Failed to execute global aggregators]]; nested:
ArithmeticException;
}{[D6h8GKwjRqO_Yem09Hu_VA][development-liquidibles::application-items][0]:
QueryPhaseExecutionException[[development-liquidibles::application-items][0]:
query[filtered(filtered(self_and_ancestors:diamonds)->cache(attr_types.diamond#color:0000d))->cache(_type:item)],from[0],size[10],sort[<custom:"sell_offer_cents":
org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@1b8c216>]:
Query Failed [Failed to execute global aggregators]]; nested:
ArithmeticException; }]",
"status": 500
}

If I change the interval to be 1.0 or greater, it works. But, I want
intervals of 0.1...

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/b8dad371-dfef-4c57-b7d8-433ee1c308c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi Mark,

This is unfortunately a known limitation of histograms today: they only
work with integer intervals.

On Mon, Oct 27, 2014 at 1:17 PM, LiquidMark mark.e.molloy@gmail.com wrote:

Hi, the following query (note bolded line):

{
"query": {
"filtered": {
"query": {
"term": {
"self_and_ancestors": "diamonds"
}
},
"filter": {
"terms": {
"attr_types.diamond#color": [
"0000d"
]
}
}
}
},
"sort": [
{
"sell_offer_cents": {
"order": "asc"
}
}
],
"fields": "_source",
"script_fields": {
"gap_cents": {
"script": "custom_score_item_bid_ask_gap",
"params": {
"individual_price_item_ids": ,
"individual_price_item_cents": ,
"pb_amount_below_cents": 0
},
"lang": "native"
}
},
"aggs": {
"all_items": {
"global": {},
"aggs": {
"gem#carats": {
"filter": {
"terms": {
"attr_types.diamond#polish": [
"0000ex",
"0001vg"
]
}
},
"aggs": {
"gems#carats": {
"histogram": {
"field": "attr_types.gem#carats",
* "interval": 0.1,*
"min_doc_count": 0
}
},
"gem#carats_stats": {
"stats": {
"field": "attr_types.gem#carats"
}
}
}
}
}
}
}
}

Gives the following error:

{
"error": "SearchPhaseExecutionException[Failed to execute phase
[query], all shards failed; shardFailures
{[D6h8GKwjRqO_Yem09Hu_VA][development-liquidibles::application-items][4]:
QueryPhaseExecutionException[[development-liquidibles::application-items][4]:
query[filtered(filtered(self_and_ancestors:diamonds)->cache(attr_types.diamond#color:0000d))->cache(_type:item)],from[0],size[10],sort[<custom:"sell_offer_cents":
org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@11ce49a>]:
Query Failed [Failed to execute global aggregators]]; nested:
ArithmeticException;
}{[D6h8GKwjRqO_Yem09Hu_VA][development-liquidibles::application-items][3]:
QueryPhaseExecutionException[[development-liquidibles::application-items][3]:
query[filtered(filtered(self_and_ancestors:diamonds)->cache(attr_types.diamond#color:0000d))->cache(_type:item)],from[0],size[10],sort[<custom:"sell_offer_cents":
org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@8c9d82>]:
Query Failed [Failed to execute global aggregators]]; nested:
ArithmeticException;
}{[D6h8GKwjRqO_Yem09Hu_VA][development-liquidibles::application-items][2]:
QueryPhaseExecutionException[[development-liquidibles::application-items][2]:
query[filtered(filtered(self_and_ancestors:diamonds)->cache(attr_types.diamond#color:0000d))->cache(_type:item)],from[0],size[10],sort[<custom:"sell_offer_cents":
org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@73a7e5>]:
Query Failed [Failed to execute global aggregators]]; nested:
ArithmeticException;
}{[D6h8GKwjRqO_Yem09Hu_VA][development-liquidibles::application-items][1]:
QueryPhaseExecutionException[[development-liquidibles::application-items][1]:
query[filtered(filtered(self_and_ancestors:diamonds)->cache(attr_types.diamond#color:0000d))->cache(_type:item)],from[0],size[10],sort[<custom:"sell_offer_cents":
org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@15d1b1a>]:
Query Failed [Failed to execute global aggregators]]; nested:
ArithmeticException;
}{[D6h8GKwjRqO_Yem09Hu_VA][development-liquidibles::application-items][0]:
QueryPhaseExecutionException[[development-liquidibles::application-items][0]:
query[filtered(filtered(self_and_ancestors:diamonds)->cache(attr_types.diamond#color:0000d))->cache(_type:item)],from[0],size[10],sort[<custom:"sell_offer_cents":
org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@1b8c216>]:
Query Failed [Failed to execute global aggregators]]; nested:
ArithmeticException; }]",
"status": 500
}

If I change the interval to be 1.0 or greater, it works. But, I want
intervals of 0.1...

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/b8dad371-dfef-4c57-b7d8-433ee1c308c6%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/b8dad371-dfef-4c57-b7d8-433ee1c308c6%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Adrien Grand

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j5oOcmh-Ne3tpoBNqaMpStskZzAYJch6R%2BtPz7hzVQV3g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Hi Adrien,

Thanks for letting me know!

-Mark

On Mon, Oct 27, 2014 at 12:14 PM, Adrien Grand <
adrien.grand@elasticsearch.com> wrote:

Hi Mark,

This is unfortunately a known limitation of histograms today: they only
work with integer intervals.

Histogram aggregations: support decimal intervals · Issue #4847 · elastic/elasticsearch · GitHub

On Mon, Oct 27, 2014 at 1:17 PM, LiquidMark mark.e.molloy@gmail.com
wrote:

Hi, the following query (note bolded line):

{
"query": {
"filtered": {
"query": {
"term": {
"self_and_ancestors": "diamonds"
}
},
"filter": {
"terms": {
"attr_types.diamond#color": [
"0000d"
]
}
}
}
},
"sort": [
{
"sell_offer_cents": {
"order": "asc"
}
}
],
"fields": "_source",
"script_fields": {
"gap_cents": {
"script": "custom_score_item_bid_ask_gap",
"params": {
"individual_price_item_ids": ,
"individual_price_item_cents": ,
"pb_amount_below_cents": 0
},
"lang": "native"
}
},
"aggs": {
"all_items": {
"global": {},
"aggs": {
"gem#carats": {
"filter": {
"terms": {
"attr_types.diamond#polish": [
"0000ex",
"0001vg"
]
}
},
"aggs": {
"gems#carats": {
"histogram": {
"field": "attr_types.gem#carats",
* "interval": 0.1,*
"min_doc_count": 0
}
},
"gem#carats_stats": {
"stats": {
"field": "attr_types.gem#carats"
}
}
}
}
}
}
}
}

Gives the following error:

{
"error": "SearchPhaseExecutionException[Failed to execute phase
[query], all shards failed; shardFailures
{[D6h8GKwjRqO_Yem09Hu_VA][development-liquidibles::application-items][4]:
QueryPhaseExecutionException[[development-liquidibles::application-items][4]:
query[filtered(filtered(self_and_ancestors:diamonds)->cache(attr_types.diamond#color:0000d))->cache(_type:item)],from[0],size[10],sort[<custom:"sell_offer_cents":
org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@11ce49a>]:
Query Failed [Failed to execute global aggregators]]; nested:
ArithmeticException;
}{[D6h8GKwjRqO_Yem09Hu_VA][development-liquidibles::application-items][3]:
QueryPhaseExecutionException[[development-liquidibles::application-items][3]:
query[filtered(filtered(self_and_ancestors:diamonds)->cache(attr_types.diamond#color:0000d))->cache(_type:item)],from[0],size[10],sort[<custom:"sell_offer_cents":
org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@8c9d82>]:
Query Failed [Failed to execute global aggregators]]; nested:
ArithmeticException;
}{[D6h8GKwjRqO_Yem09Hu_VA][development-liquidibles::application-items][2]:
QueryPhaseExecutionException[[development-liquidibles::application-items][2]:
query[filtered(filtered(self_and_ancestors:diamonds)->cache(attr_types.diamond#color:0000d))->cache(_type:item)],from[0],size[10],sort[<custom:"sell_offer_cents":
org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@73a7e5>]:
Query Failed [Failed to execute global aggregators]]; nested:
ArithmeticException;
}{[D6h8GKwjRqO_Yem09Hu_VA][development-liquidibles::application-items][1]:
QueryPhaseExecutionException[[development-liquidibles::application-items][1]:
query[filtered(filtered(self_and_ancestors:diamonds)->cache(attr_types.diamond#color:0000d))->cache(_type:item)],from[0],size[10],sort[<custom:"sell_offer_cents":
org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@15d1b1a>]:
Query Failed [Failed to execute global aggregators]]; nested:
ArithmeticException;
}{[D6h8GKwjRqO_Yem09Hu_VA][development-liquidibles::application-items][0]:
QueryPhaseExecutionException[[development-liquidibles::application-items][0]:
query[filtered(filtered(self_and_ancestors:diamonds)->cache(attr_types.diamond#color:0000d))->cache(_type:item)],from[0],size[10],sort[<custom:"sell_offer_cents":
org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@1b8c216>]:
Query Failed [Failed to execute global aggregators]]; nested:
ArithmeticException; }]",
"status": 500
}

If I change the interval to be 1.0 or greater, it works. But, I want
intervals of 0.1...

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/b8dad371-dfef-4c57-b7d8-433ee1c308c6%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/b8dad371-dfef-4c57-b7d8-433ee1c308c6%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Adrien Grand

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/nlY-XY3PBd8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j5oOcmh-Ne3tpoBNqaMpStskZzAYJch6R%2BtPz7hzVQV3g%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j5oOcmh-Ne3tpoBNqaMpStskZzAYJch6R%2BtPz7hzVQV3g%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--

  • Mark Molloy
    (641)218-8265

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CALL%2BC8DPDUMPj2jKzuSZHXg4jkR6jM90XbW0cVwQK8WAbT_3GQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.