-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Added pre and post offset to histogram aggregation #6980
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
Conversation
@@ -127,6 +127,59 @@ public void writeTo(StreamOutput out) throws IOException { | |||
out.writeVLong(interval); | |||
} | |||
} | |||
|
|||
public static class PrePostIntervalRounding extends TimeZoneRounding { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks very similar to PrePostTimeZoneRounding. Do you think we can reuse it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I tried doing that and creating a PrePostRounding which extended Rounding, but TimeZoneRounding.Builder expects everything thats returned to be an instance of TimeZoneRounding so would mean changing FactorTimeZoneRounding to accept a Rounding delegate and change the build() method to return Rounding instead of TimeZoneRounding. Not sure if that makes things too messy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TimeZoneRounding.Builder expects everything thats returned to be an instance of TimeZoneRounding
TimeZoneRounding doesn't add anything on top of Rounding so I think it's ok to return/expect Rounding instances here.
LGTM |
pushed to master and 1.x |
Added preOffset and postOffset parameters to the API for the histogram aggregation which work in the same way as in the date histogram
Closes #6605