-
Notifications
You must be signed in to change notification settings - Fork 350
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix incompatible es java date format (#5462)
* fix(es): add java date format support * Adding rest integration test * Bugfix: expressing date in rfc3339. unit test + integration test * fix: add week patterns * Add support for variable zone offset type ES supports 3 formats at the same time. To do the same we will use `First` format item with multiple options. * Replace regexp tokenizer with recursion parser In the current implementation, the RegexTokenizer uses regular expressions to tokenize the format string. However, regular expressions are not well-suited for parsing nested structures like nested brackets because they cannot match patterns with recursive depth. To address this, we'll write a custom recursive parser that can handle nested optional brackets. This parser will process the format string character by character, building the format items and managing the nesting of optional components. That change allowed me to cover `strict_date_optional_time` which has a nested depth according to the examples in [OS repo][2] Additional tests taken from [the doc][1] [1]: https://opensearch.org/docs/latest/field-types/supported-field-types/date/ [2]: https://github.com/opensearch-project/OpenSearch/blob/main/server/src/test/java/org/opensearch/common/time/DateFormattersTests.java * Move StrptimeParser and Java related parsers to a dedicated file This way it is easier to keep it manageable and clearly separate QW API DatParser logic and ES API related parser. Tests moved together with the code base. * Add additional test to cover initially reported issue This test covers that we actually can call ES API endpoint with named alias as a formatter. #5460 --------- Co-authored-by: Eugene Tolbakov <[email protected]> Co-authored-by: Paul Masurel <[email protected]>
- Loading branch information
1 parent
efac619
commit 6373edb
Showing
9 changed files
with
908 additions
and
195 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.