-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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 rounding for date math parsing #90458
Conversation
Hi @pgomulka, I've created a changelog YAML for you. |
Pinging @elastic/es-core-infra (Team:Core/Infra) |
…o date_range_defaulting_fix
range: | ||
date: | ||
gte: 1500 #1500-01-01T00:00:00 | ||
lte: 1500 #1500-01-01T23:59:59 |
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.
I don't think this is right? If you're asking for things in the range 1500 to 1500, you expect to find stuff on the 31st December 1500, but this is rounding to midnight on the 1st January
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.
but did we had that behaviour in the past? It might be a bug on its own, but I thought that this is how it always worked
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.
Testing on a 7x install it seems you're right, this has always been broken. But it's still a bug. Is it simple to fix here or should we merge this PR as-is and work on that separately?
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.
agree this is a bug (or a missing feature at least). I think this would require some more work. It would make 2 cases for rounding (up and down) I am happy to raise an issue where we could gather all the use cases
@elasticmachine update branch |
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! Thanks!
I wonder if we should try to make this fix in the 8.4.3 release too? Is it too late? |
I think it is too late now. |
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
in elastic#89693 the rounding logic was only applied when a field was present on a pattern. This is incorrect as for dates like "2020" we want to default to "2020-01-01T23:59:59.999..." when rounding is enabled. This commit always applies monthOfYear or dayofMonth defaulting (when rounding enabled) except when the dayOfYear is set closes elastic#90187 (cherry picked from commit 3f3a95e)
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
in elastic#89693 the rounding logic was only applied when a field was present on a pattern. This is incorrect as for dates like "2020" we want to default to "2020-01-01T23:59:59.999..." when rounding is enabled. This commit always applies monthOfYear or dayofMonth defaulting (when rounding enabled) except when the dayOfYear is set closes elastic#90187 (cherry picked from commit 3f3a95e) # Conflicts: # server/src/test/java/org/elasticsearch/common/time/DateFormattersTests.java
in #89693 the rounding logic was only applied when a field was present on a pattern. This is incorrect as for dates like "2020" we want to default to "2020-01-01T23:59:59.999..." when rounding is enabled. This commit always applies monthOfYear or dayofMonth defaulting (when rounding enabled) except when the dayOfYear is set closes #90187 backports #90458
* Fix date rounding for date math parsing (#90458) in #89693 the rounding logic was only applied when a field was present on a pattern. This is incorrect as for dates like "2020" we want to default to "2020-01-01T23:59:59.999..." when rounding is enabled. This commit always applies monthOfYear or dayofMonth defaulting (when rounding enabled) except when the dayOfYear is set closes #90187 backport(#90458) (cherry picked from commit 3f3a95e)
the test should be enabled as the fix is applied in 7.x branch relates elastic#90458
the elastic#90458 has been backported to all branches so the bwc testing can be enable for this
the elastic#90458 has been backported to all branches so the bwc testing can be enable for this tests were incorrectly relying on sort order. Added sort to make it deterministic closes elastic#90668
the elastic#90458 has been backported to all branches so the bwc testing can be enable for this tests were incorrectly relying on sort order. Added sort to make it deterministic closes elastic#90668
the elastic#90458 has been backported to all branches so the bwc testing can be enable for this tests were incorrectly relying on sort order. Added sort to make it deterministic closes elastic#90668
…tic#90633) in elastic#89693 the rounding logic was only applied when a field was present on a pattern. This is incorrect as for dates like "2020" we want to default to "2020-01-01T23:59:59.999..." when rounding is enabled. This commit always applies monthOfYear or dayofMonth defaulting (when rounding enabled) except when the dayOfYear is set closes elastic#90187 backports elastic#90458
in #89693 the rounding logic was only applied when a field was present on a pattern. This is incorrect as for dates like "2020" we want to default to "2020-01-01T23:59:59.999..." when rounding is enabled. This commit always applies monthOfYear or dayofMonth defaulting (when rounding enabled) except when the dayOfYear is set closes #90187 backports #90458
…elastic#90690) the elastic#90458 has been backported to all branches so the bwc testing can be enable for this tests were incorrectly relying on sort order. Added sort to make it deterministic closes elastic#90668
in #89693 the rounding logic was only applied when a field was present on a pattern. This is incorrect as for dates like "2020" we want to default to "2020-01-01T23:59:59.999..." when rounding is enabled.
This commit always applies
monthOfYear
ordayofMonth
defaulting (when rounding enabled) except when thedayOfYear
is setcloses #90187