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

Fix date_nanos in composite aggs (#53315) #53347

Merged
merged 2 commits into from
Mar 11, 2020

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented Mar 10, 2020

It looks like date_nanos fields weren't likely to work properly in
composite aggs because composites iterate field values using points and
we weren't converting the points into milliseconds. Because the doc
values were coming back in milliseconds we ended up geting very confused
and just never collecting sub-aggregations.

This fixes that by adding a method to DateFieldMapper.Resolution to
parsePointAsMillis which is similarly in name and function to
NumberFieldMapper.NumberType's parsePoint except that it normalizes
to milliseconds which is what aggs need at the moment.

Closes #53168

It looks like `date_nanos` fields weren't likely to work properly in
composite aggs because composites iterate field values using points and
we weren't converting the points into milliseconds. Because the doc
values were coming back in milliseconds we ended up geting very confused
and just never collecting sub-aggregations.

This fixes that by adding a method to `DateFieldMapper.Resolution` to
`parsePointAsMillis` which is similarly in name and function to
`NumberFieldMapper.NumberType`'s `parsePoint` except that it normalizes
to milliseconds which is what aggs need at the moment.

Closes elastic#53168
@nik9000 nik9000 merged commit 9ada508 into elastic:7.x Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant