-
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
Add TIMEDIFF
and DATEDIFF
functions. (#131)
#1195
Add TIMEDIFF
and DATEDIFF
functions. (#131)
#1195
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1195 +/- ##
=======================================
Coverage 62.76% 62.76%
=======================================
Files 10 10
Lines 658 658
Branches 119 119
=======================================
Hits 413 413
Misses 192 192
Partials 53 53
Flags with carried forward coverage won't be shown. Click here to find out more. Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
* Add `TIMEDIFF` and `DATEDIFF` functions. Signed-off-by: Yury-Fridlyand <yuryf@bitquilltech.com> Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> Co-authored-by: Max Ksyunz <maxk@bitquilltech.com> Signed-off-by: Yury-Fridlyand <yuryf@bitquilltech.com> Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> Co-authored-by: Max Ksyunz <maxk@bitquilltech.com> (cherry picked from commit 438c44d)
* Add `TIMEDIFF` and `DATEDIFF` functions. Signed-off-by: Yury-Fridlyand <yuryf@bitquilltech.com> Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> Co-authored-by: Max Ksyunz <maxk@bitquilltech.com> Signed-off-by: Yury-Fridlyand <yuryf@bitquilltech.com> Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> Co-authored-by: Max Ksyunz <maxk@bitquilltech.com> (cherry picked from commit 438c44d) Co-authored-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Hi I don't see these functions available in latest version https://opensearch.org/docs/latest/search-plugins/sql/functions/#date-and-time. Can you please confirm if these are available? If not, by when these will be made available? |
@VenkatManuru, |
Signed-off-by: Yury-Fridlyand yuryf@bitquilltech.com
Description
I referred to MySQL docs and tried to reproduce MySQL v.8.0.30 behavior as a reference.
See team review and discussion on Bit-Quill#131
New function:
TIMEDIFF
.Changes
Signature
Future changes (TODOs):
TIME
? #852Test queries:
New function:
DATEDIFF
.Changes
Fully compliant with MySQL.
Signature
Future changes (TODOs):
Accept strings if it gives performance gain
Test queries:
Test data
I found that first 6 rows from
date0
,time0
,time1
,datetime0
are good for testing - these columns have different data types in MySQL. In OpenSearch SQL all[date][time]
columns havetimestamp
type, so I useCAST
for clear testing.data
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.