-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
fixes error with custom interval in datetime aggregation #9427
Conversation
jenkins, test this |
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.
LGTM:
Likely due to elastic/elasticsearch#19102 in the first place.
@@ -3,7 +3,7 @@ import dateMath from '@elastic/datemath'; | |||
export default function () { | |||
|
|||
const unitsDesc = dateMath.unitsDesc; | |||
const largeMax = unitsDesc.indexOf('M'); | |||
const largeMax = unitsDesc.indexOf('w'); |
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.
add some explanation here, since this is somewhat of a magic number.
this probably needs rebasing as well. |
jenkins, test this |
Functional LGTM |
The docs state, that the Date Histogram aggregation uses the time-units for the interval in addition to: However, it appears that the following undocumented values are also valid for the interval: |
It might be helpful to document why we're limiting the "large units" from being anything but 1, as it's using undocumented values that on first glance appear to be invalid. Or, it might be prudent to not rely on the undocumented values. |
@epixa @spalger @Bargs what are your opinions, what direction should we take this ?
|
Supporting those undocumented values seems like it could only lead to confusion for the user, particularly because they look so similar to the "time-units" Brandon mentioned. I wouldn't rely on them personally. However I'd also check with the ES team to see what's up with these mystery values. Perhaps they could add week support to time-units and start throwing errors for these undocumented values. Alternatively, and this might be the best approach but the most work, you could define a set of valid interval values in kibana, and then translate them into some valid, lowest common denominator unit for ES. e.g. 2 weeks becomes 1209600000 milliseconds |
this is not the right approach, so closing this. |
fixes error with custom interval in datetime aggregation with values like 2w
closes #9184