-
Notifications
You must be signed in to change notification settings - Fork 180
Fix: Date field format parsing for legacy query engine #3160
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 field format parsing for legacy query engine #3160
Conversation
Signed-off-by: Andy Kwok <[email protected]>
Signed-off-by: Andy Kwok <[email protected]>
|
@parked-toes, @dai-chen and @anasalkouz |
Signed-off-by: Andy Kwok <[email protected]>
|
@dai-chen I have fixed the spotlessJavaCheck, and tested it offline. |
legacy/src/main/java/org/opensearch/sql/legacy/executor/format/DateFieldFormatter.java
Show resolved
Hide resolved
|
@andy-k-improving It seem CI is failing on IT task. I've triggered the CI again. Please check if there is still failure. |
Signed-off-by: Andy Kwok <[email protected]>
Thanks, indeed we have a breaking change on the date field presentation on v1 engine (The old engine). |
Signed-off-by: Andy Kwok <[email protected]>
|
I have updated |
|
@dai-chen Would you mind to have another look on this? |
YANG-DB
left a comment
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.
@andy-k-improving looks good !
* Test cases Signed-off-by: Andy Kwok <[email protected]> * Minimise code changes Signed-off-by: Andy Kwok <[email protected]> * Format Signed-off-by: Andy Kwok <[email protected]> * Update integration test Signed-off-by: Andy Kwok <[email protected]> * Update unit test Signed-off-by: Andy Kwok <[email protected]> --------- Signed-off-by: Andy Kwok <[email protected]> (cherry picked from commit eb88e3c) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Test cases Signed-off-by: Andy Kwok <[email protected]> * Minimise code changes Signed-off-by: Andy Kwok <[email protected]> * Format Signed-off-by: Andy Kwok <[email protected]> * Update integration test Signed-off-by: Andy Kwok <[email protected]> * Update unit test Signed-off-by: Andy Kwok <[email protected]> --------- Signed-off-by: Andy Kwok <[email protected]> (cherry picked from commit eb88e3c) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Test cases * Minimise code changes * Format * Update integration test * Update unit test --------- (cherry picked from commit eb88e3c) Signed-off-by: Andy Kwok <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Test cases * Minimise code changes * Format * Update integration test * Update unit test --------- (cherry picked from commit eb88e3c) Signed-off-by: Andy Kwok <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…oject#3160) (opensearch-project#3596) * Test cases * Minimise code changes * Format * Update integration test * Update unit test --------- (cherry picked from commit eb88e3c) Signed-off-by: Andy Kwok <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Signed-off-by: Kai Huang <[email protected]>
* Fix: Date field format parsing for legacy query engine (#3160) (#3596) * Test cases * Minimise code changes * Format * Update integration test * Update unit test --------- (cherry picked from commit eb88e3c) Signed-off-by: Andy Kwok <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Signed-off-by: Kai Huang <[email protected]> * fix snapshot uploading (#4006) Signed-off-by: Kai Huang <[email protected]> (cherry picked from commit 37d2d64) --------- Signed-off-by: Andy Kwok <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Signed-off-by: Kai Huang <[email protected]> Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
This is a MR, which aim to fix the issue described over #1545 to align the representation of
datefield between the legacy engine and the v2 engine.Code changes highlight:
breakidentifier fromDateFieldFormatter, the current behaviour will only parse the firstdatefield from the resultSet, which is not a valid assumption, because OpenSearch as platform allow multipledatefields co-exist on an index, also this is not an uncommon use-case for enterprise. Hence alldatefields present on any given index should be formatted regardless of the order.epoch_millisbeing explicitly specified on field format, in this particular case there is no clear hint from the query indicate this is numeric timestamp from OpenSearch.Although issue is being reported #1545 under nested-query, however this bug has wider impact outside of nested-query, and the conditions to trigger are:
datefields are being specified on the Index schema WITHOUT any explicitformatconfiguration.When this happen, the current behaviour will only parse the first
datefield from the resultset.Reference doc:
https://opensearch.org/docs/latest/field-types/supported-field-types/date/
Related Issues
Resolves #1545
Testing plan
Check List
--signoff.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.