-
Notifications
You must be signed in to change notification settings - Fork 0
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 functions PERIOD_ADD
and PERIOD_DIFF
.
#130
Add functions PERIOD_ADD
and PERIOD_DIFF
.
#130
Conversation
Signed-off-by: Yury-Fridlyand <[email protected]>
Codecov Report
@@ Coverage Diff @@
## integ-datetime-period-functions #130 +/- ##
=====================================================================
- Coverage 97.87% 95.03% -2.85%
- Complexity 3020 3029 +9
=====================================================================
Files 284 294 +10
Lines 7425 8111 +686
Branches 475 597 +122
=====================================================================
+ Hits 7267 7708 +441
- Misses 157 349 +192
- Partials 1 54 +53
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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
@@ -68,6 +69,7 @@ | |||
* 2) the implementation should rely on ExprValue. | |||
*/ | |||
@UtilityClass | |||
@SuppressWarnings("unchecked") |
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.
can we move this to the specific lines that fail instead of suppressing warnings everywhere in the file?
*/ | ||
public static Stream<Arguments> getInvalidTestData() { | ||
return Stream.of( | ||
Arguments.of(0), |
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.
do we need to try negative numbres
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.
I think we should try negative numbers so we're covering all possible cases
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.
Thank you, fixed in cc8edf6.
import org.json.JSONObject; | ||
import org.junit.jupiter.api.Test; | ||
import org.opensearch.sql.common.utils.StringUtils; | ||
|
||
@SuppressWarnings("unchecked") |
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.
what is this suppressing?
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.
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
*/ | ||
public static Stream<Arguments> getTestDataForPeriodAdd() { | ||
return Stream.of( | ||
Arguments.of(1, 3, 200004), // Jan 2000 + 3 |
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.
Is this April 2000 instead of Jan 2000?
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.
Last argument is the expected result value.
Signed-off-by: Yury-Fridlyand <[email protected]>
Add XYPoint Field Type to index and query documents that contains cartesian points
Signed-off-by: Yury-Fridlyand [email protected]
Description
I referred to MySQL docs and tried to reproduce MySQL v.8.0.30 behavior as a reference.
New function:
PERIOD_ADD
.Changes
Fully compliant with MySQL.
Signature
Future changes (TODOs):
Update if and after opensearch-project#862
Notes
Not documented, but with experiments I discovered that
2000 + x
.Test queries:
New function:
PERIOD_DIFF
.Changes
Fully compliant with MySQL.
Signature
Future changes (TODOs):
Update if and after opensearch-project#862
Notes
Not documented, but with experiments I discovered that
2000 + x
.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.