-
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
Function str_to_date
should work with two-digits year
#2841
Conversation
Signed-off-by: Lantao Jin <[email protected]>
str_to_date
should work with two-digits year
@@ -173,7 +173,7 @@ interface DateTimeFormatHandler { | |||
.put("%T", "HH:mm:ss") // %T => HH:mm:ss | |||
.put("%W", "EEEE") // %W => EEEE - Weekday name (Sunday..Saturday) | |||
.put("%Y", "u") // %Y => yyyy - Year, numeric, 4 digits | |||
.put("%y", "u") // %y => yy - Year, numeric, 2 digits | |||
.put("%y", "uu") // %y => yy - Year, numeric, 2 digits |
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 change fixes the issue because the code:
https://github.com/openjdk/jdk/blob/35df48e1b321d16f44ba924065143af67143cf95/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java#L2063-L2069
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.
Thanks for the fix!
This PR is stalled because it has been open for 30 days with no activity. |
@LantaoJin @dai-chen is this still relevant ? |
I think the issue is still existing. let me update to latest code base. |
CI failure not related. Merging |
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/sql/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/sql/backport-2.x
# Create a new branch
git switch --create backport/backport-2841-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 4224f318871d4bf8cb35764fb7f589530449a0de
# Push it to GitHub
git push --set-upstream origin backport/backport-2841-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/sql/backport-2.x Then, create a pull request where the |
…ject#2841) Signed-off-by: Lantao Jin <[email protected]> (cherry picked from commit 4224f31)
Description
str_to_date
function in https://opensearch.org/docs/latest/search-plugins/sql/functions/#date-and-time does not work with two-digits year (RFC 822 date-time formatted).SELECT str_to_date('23-Oct-17', '%d-%b-%y')
returns0017-10-23
With patching, above query returns
2017-10-23
.Issues Resolved
Resolves #2741
Check List
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.