Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Missing" aggregation fails when object containing aggregation field is missing as well #5190

Closed
roytmana opened this issue Feb 20, 2014 · 3 comments · Fixed by #5205
Closed

Comments

@roytmana
Copy link

say our data structure is

invoice:{
  vendor:{
    id:10
    name: "google"
  }
}

vendor object is optional to the invoice and may be absent

when calculating missing aggregation on vendor.id it fails with

earchPhaseExecutionException[Failed to execute phase [query_fetch], all shards failed; shardFailures {[mr2aF25CTPGrkvzftHq9Rg][award][0]: ClassCastException[org.elasticsearch.search.aggregations.support.FieldDataSource$Bytes$FieldData cannot be cast to org.elasticsearch.search.aggregations.support.FieldDataSource$Numeric]}]

I would expect missing aggregation to treat missing parent objects of the field the aggregation is calculated for as if the field itself is missing or it would be virtually impossible to guarantee that such aggregation would finish successfully over deeply nested graphs where any part of the path to the missing field may be absent

@jpountz
Copy link
Contributor

jpountz commented Feb 20, 2014

Indeed the missing aggregation should work on fields that are not mapped and count every hit as a document that misses the field.

I just tried to reproduce this issue without luck, could you please try to either provide us with a curl recreation or give the stacktrace of the ClassCastException in the logs? Thanks.

@jpountz jpountz self-assigned this Feb 20, 2014
@roytmana
Copy link
Author

@jpountz No logs just what I get in the response (maybe I need to switch in debug mode?)

here is the recreation. it does not fail if missing is the only aggregation or the sibling bucket aggs is on some other field only when you do say terms on a field and next to it missing on the same field
so the issue may be slightly different that I thought initially

https://gist.github.com/roytmana/9114933

@uboness
Copy link
Contributor

uboness commented Feb 20, 2014

hi @roytmana, this is indeed a bug, will be working on fixing it. Thx for reporting!

uboness added a commit that referenced this issue Feb 20, 2014
…ame + required Value Source type as a combi key (used to be only field name). This fixes a problem where multiple aggregations where defined on the same field, yet require different types of value sources.

Closes #5190
uboness added a commit that referenced this issue Feb 20, 2014
…ame + required Value Source type as a combi key (used to be only field name). This fixes a problem where multiple aggregations where defined on the same field, yet require different types of value sources.

Closes #5190
@uboness uboness added the bug label Feb 20, 2014
@uboness uboness assigned uboness and unassigned jpountz Feb 20, 2014
olivere added a commit to olivere/elastic that referenced this issue Nov 2, 2014
Tests most probably failed because of #5190 (see
elastic/elasticsearch#5190).
I'm not entirely sure why this succeeds in 1.3.4 but fails with
1.4.0.Beta1 though.
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
…ame + required Value Source type as a combi key (used to be only field name). This fixes a problem where multiple aggregations where defined on the same field, yet require different types of value sources.

Closes elastic#5190
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants