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

Support offset in composite aggs (backport of #50609) #50808

Merged
merged 1 commit into from
Jan 9, 2020

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented Jan 9, 2020

Adds support for the offset parameter to the date_histogram source
of composite aggs. The offset parameter is supported by the normal
date_histogram aggregation and is useful for folks that need to
measure things from, say, 6am one day to 6am the next day.

This is implemented by creating a new Rounding that knows how to
handle offsets and delegates to other rounding implementations. That
implementation doesn't fully implement the Rounding contract, namely
nextRoundingValue. That method isn't used by composite aggs so I can't
be sure that any implementation that I add will be correct. I propose to
leave it throwing UnsupportedOperationException until I need it.

Closes #48757

Adds support for the `offset` parameter to the `date_histogram` source
of composite aggs. The `offset` parameter is supported by the normal
`date_histogram` aggregation and is useful for folks that need to
measure things from, say, 6am one day to 6am the next day.

This is implemented by creating a new `Rounding` that knows how to
handle offsets and delegates to other rounding implementations. That
implementation doesn't fully implement the `Rounding` contract, namely
`nextRoundingValue`. That method isn't used by composite aggs so I can't
be sure that any implementation that I add will be correct. I propose to
leave it throwing `UnsupportedOperationException` until I need it.

Closes elastic#48757
@nik9000 nik9000 merged commit 1d8e51f into elastic:7.x Jan 9, 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.

1 participant