-
Notifications
You must be signed in to change notification settings - Fork 141
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
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? |
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 !
Description
This is a MR, which aim to fix the issue described over #1545 to align the representation of
date
field between the legacy engine and the v2 engine.Code changes highlight:
break
identifier fromDateFieldFormatter
, the current behaviour will only parse the firstdate
field from the resultSet, which is not a valid assumption, because OpenSearch as platform allow multipledate
fields co-exist on an index, also this is not an uncommon use-case for enterprise. Hence alldate
fields present on any given index should be formatted regardless of the order.epoch_millis
being 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:
date
fields are being specified on the Index schema WITHOUT any explicitformat
configuration.When this happen, the current behaviour will only parse the first
date
field 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.