-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[6.8] Week based parsing for ingest date processor (#58597) #58805
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
Date processor was incorrectly parsing week based dates because when a weekbased year was provided ingest module was thinking year was not on a date and was trying to applying the logic for dd/MM type of dates. Date Processor is also allowing users to specify locale parameter. It should be taken into account when parsing dates - currently only used for formatting. If someone specifies 'en-us' locale, then calendar data rules for that locale should be used. The exception is iso8601 format. If someone is using that format, then locale should not override calendar data rules. closes elastic#58479 # Conflicts: # modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/DateFormat.java # modules/ingest-common/src/test/resources/rest-api-spec/test/ingest/30_date_processor.yml # server/src/main/java/org/elasticsearch/common/time/DateFormatters.java # server/src/main/java/org/elasticsearch/common/time/IsoCalendarDataProvider.java # server/src/main/java/org/elasticsearch/index/mapper/DateFieldMapper.java # server/src/main/java/org/elasticsearch/script/JodaCompatibleZonedDateTime.java
|
Pinging @elastic/es-core-infra (:Core/Infra/Core) |
| * Java based - formats with '8' prefix - week based parsing and calculations are using JDK default calendar data provider which is Sunday,1. | ||
| Sunday is considered first day of a week and it requires only 1 day in a week to for the first week of the year. | ||
| It can be worked around by using locale which is based on ISO8601 rule (Monday,4) - for instance en-GB | ||
| This issue is fixed in Elasticsearch 7.7 https://github.com/elastic/elasticsearch/pull/48209 |
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 description is confusing. Is the bug fixed here or in 7.7.0?
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.
fair point, I will try to rephrase this in another doc PR.
Previously the parsing would fail with exception.
This PR fixes the bug so that parsing does not fail, but is uses Sunday,1 rule. So results are slightly different around when the year or week starts.
The 'ultimate' fixes are in 7.7 when IsoCalendarDataProvider is used and -Djava.locale.providers=SPI,COMPAT is set in jvm options
Backports the following commits to 6.8: