-
Notifications
You must be signed in to change notification settings - Fork 146
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
Add The TO_SECONDS
Function To The SQL Plugin
#1419
Add The TO_SECONDS
Function To The SQL Plugin
#1419
Conversation
* Added Basic Tests Signed-off-by: GabeFernandez310 <[email protected]> * Added IT Test Signed-off-by: GabeFernandez310 <[email protected]> * Added Implementation Signed-off-by: GabeFernandez310 <[email protected]> * Changed Integration Tests Signed-off-by: GabeFernandez310 <[email protected]> * Added Test For Time Type Signed-off-by: GabeFernandez310 <[email protected]> * Added Documentation Signed-off-by: GabeFernandez310 <[email protected]> * Addressed PR Comments Signed-off-by: GabeFernandez310 <[email protected]> * Fixed Docs and Implementation Signed-off-by: GabeFernandez310 <[email protected]> * Fixed Checkstyle Signed-off-by: GabeFernandez310 <[email protected]> * Changed DateTimeFormatter Priority Signed-off-by: GabeFernandez310 <[email protected]> * Added More Formatters Signed-off-by: GabeFernandez310 <[email protected]> * Updated Docs Signed-off-by: GabeFernandez310 <[email protected]> * Reworked Implementation For Formatters Signed-off-by: GabeFernandez310 <[email protected]> * Cleanup Signed-off-by: GabeFernandez310 <[email protected]> * Added Test Signed-off-by: GabeFernandez310 <[email protected]> * Fixed Implementation And Code Coverage Signed-off-by: GabeFernandez310 <[email protected]> * Changed getFormatter Function Signed-off-by: GabeFernandez310 <[email protected]> * Added Comments Signed-off-by: GabeFernandez310 <[email protected]> --------- Signed-off-by: GabeFernandez310 <[email protected]>
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #1419 +/- ##
=========================================
Coverage 98.38% 98.39%
- Complexity 3693 3711 +18
=========================================
Files 343 343
Lines 9107 9162 +55
Branches 585 588 +3
=========================================
+ Hits 8960 9015 +55
Misses 142 142
Partials 5 5
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 4 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
LGTM
core/src/test/java/org/opensearch/sql/expression/datetime/ToSecondsTest.java
Outdated
Show resolved
Hide resolved
e0614e2
Signed-off-by: GabeFernandez310 <[email protected]>
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-1419-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 d38a6ec20d1ddc035adf53f610af05cfad812b6a
# Push it to GitHub
git push --set-upstream origin backport/backport-1419-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x Then, create a pull request where the |
) * Add The `TO_SECONDS` Function To The SQL Plugin (#232) * Added Basic Tests Signed-off-by: GabeFernandez310 <[email protected]> * Added IT Test Signed-off-by: GabeFernandez310 <[email protected]> * Added Implementation Signed-off-by: GabeFernandez310 <[email protected]> * Changed Integration Tests Signed-off-by: GabeFernandez310 <[email protected]> * Added Test For Time Type Signed-off-by: GabeFernandez310 <[email protected]> * Added Documentation Signed-off-by: GabeFernandez310 <[email protected]> * Addressed PR Comments Signed-off-by: GabeFernandez310 <[email protected]> * Fixed Docs and Implementation Signed-off-by: GabeFernandez310 <[email protected]> * Fixed Checkstyle Signed-off-by: GabeFernandez310 <[email protected]> * Changed DateTimeFormatter Priority Signed-off-by: GabeFernandez310 <[email protected]> * Added More Formatters Signed-off-by: GabeFernandez310 <[email protected]> * Updated Docs Signed-off-by: GabeFernandez310 <[email protected]> * Reworked Implementation For Formatters Signed-off-by: GabeFernandez310 <[email protected]> * Cleanup Signed-off-by: GabeFernandez310 <[email protected]> * Added Test Signed-off-by: GabeFernandez310 <[email protected]> * Fixed Implementation And Code Coverage Signed-off-by: GabeFernandez310 <[email protected]> * Changed getFormatter Function Signed-off-by: GabeFernandez310 <[email protected]> * Added Comments Signed-off-by: GabeFernandez310 <[email protected]> --------- Signed-off-by: GabeFernandez310 <[email protected]> * Removed Unneeded Code Signed-off-by: GabeFernandez310 <[email protected]> --------- Signed-off-by: GabeFernandez310 <[email protected]> (cherry picked from commit d38a6ec)
* Add The `TO_SECONDS` Function To The SQL Plugin (#232) * Added Basic Tests Signed-off-by: GabeFernandez310 <[email protected]> * Added IT Test Signed-off-by: GabeFernandez310 <[email protected]> * Added Implementation Signed-off-by: GabeFernandez310 <[email protected]> * Changed Integration Tests Signed-off-by: GabeFernandez310 <[email protected]> * Added Test For Time Type Signed-off-by: GabeFernandez310 <[email protected]> * Added Documentation Signed-off-by: GabeFernandez310 <[email protected]> * Addressed PR Comments Signed-off-by: GabeFernandez310 <[email protected]> * Fixed Docs and Implementation Signed-off-by: GabeFernandez310 <[email protected]> * Fixed Checkstyle Signed-off-by: GabeFernandez310 <[email protected]> * Changed DateTimeFormatter Priority Signed-off-by: GabeFernandez310 <[email protected]> * Added More Formatters Signed-off-by: GabeFernandez310 <[email protected]> * Updated Docs Signed-off-by: GabeFernandez310 <[email protected]> * Reworked Implementation For Formatters Signed-off-by: GabeFernandez310 <[email protected]> * Cleanup Signed-off-by: GabeFernandez310 <[email protected]> * Added Test Signed-off-by: GabeFernandez310 <[email protected]> * Fixed Implementation And Code Coverage Signed-off-by: GabeFernandez310 <[email protected]> * Changed getFormatter Function Signed-off-by: GabeFernandez310 <[email protected]> * Added Comments Signed-off-by: GabeFernandez310 <[email protected]> --------- Signed-off-by: GabeFernandez310 <[email protected]> * Removed Unneeded Code Signed-off-by: GabeFernandez310 <[email protected]> --------- Signed-off-by: GabeFernandez310 <[email protected]> (cherry picked from commit d38a6ec)
Description
Adds the
to_seconds
function to the SQL plugin. Takes aDATE
/TIME
/DATETIME
/TIMESTAMP
/STRING
/INTEGER
representing a point in time, and converts it to seconds since the year 0. This function is based off of MySQL. For arguments of typeTIME
, the function takes the current date at the given time. ForINTEGER
, the integer is parsed as a date (e.g.950501
==1995-05-01
).Examples:
SELECT TO_SECONDS(950501);
->62966505600
SELECT TO_SECONDS('2009-11-29');
->63426672000
SELECT TO_SECONDS('2009-11-29 13:43:32');
->63426721412
Issues Resolved
#722
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.