-
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 UTC_DATE, UTC_TIME, UTC_TIMESTAMP #187
Add UTC_DATE, UTC_TIME, UTC_TIMESTAMP #187
Conversation
Signed-off-by: MitchellGale-BitQuill <[email protected]>
Signed-off-by: MitchellGale-BitQuill <[email protected]>
Signed-off-by: MitchellGale-BitQuill <[email protected]>
Codecov Report
@@ Coverage Diff @@
## Integ-UTC_DATE_TIME_TIMESTAMP_LIKENOW #187 +/- ##
============================================================================
- Coverage 98.31% 62.76% -35.55%
============================================================================
Files 348 10 -338
Lines 8707 658 -8049
Branches 555 119 -436
============================================================================
- Hits 8560 413 -8147
- Misses 142 192 +50
- Partials 5 53 +48
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.
Please, update ppl/src/test/java/org/opensearch/sql/ppl/antlr/NowLikeFunctionParserTest.java
and sql/src/test/java/org/opensearch/sql/sql/parser/AstNowLikeFunctionTest.java
too
core/src/main/java/org/opensearch/sql/expression/datetime/DateTimeFunction.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/opensearch/sql/expression/datetime/DateTimeFunction.java
Outdated
Show resolved
Hide resolved
integ-test/src/test/java/org/opensearch/sql/sql/DateTimeFunctionIT.java
Outdated
Show resolved
Hide resolved
integ-test/src/test/java/org/opensearch/sql/sql/DateTimeFunctionIT.java
Outdated
Show resolved
Hide resolved
integ-test/src/test/java/org/opensearch/sql/sql/DateTimeFunctionIT.java
Outdated
Show resolved
Hide resolved
Signed-off-by: MitchellGale-BitQuill <[email protected]>
Signed-off-by: MitchellGale-BitQuill <[email protected]>
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.
A couple minor style comments but everything else LGTM.
private DefaultFunctionResolver utc_time() { | ||
return define(BuiltinFunctionName.UTC_TIME.getName(), | ||
implWithProperties(functionProperties | ||
-> DateTimeFunction.exprUtcTime(functionProperties), TIME)); |
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.
-> DateTimeFunction.exprUtcTime(functionProperties), TIME)); | |
->exprUtcTime(functionProperties), TIME)); |
Doesn't this comment apply here as well?
private DefaultFunctionResolver utc_timestamp() { | ||
return define(BuiltinFunctionName.UTC_TIMESTAMP.getName(), | ||
implWithProperties(functionProperties | ||
-> DateTimeFunction.exprUtcTimeStamp(functionProperties), DATETIME)); |
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.
-> DateTimeFunction.exprUtcTimeStamp(functionProperties), DATETIME)); | |
->exprUtcTimeStamp(functionProperties), DATETIME)); |
Doesn't this comment apply here as well?
Signed-off-by: MitchellGale-BitQuill <[email protected]>
Description
Adds functionality for
UTC_TIME
,UTC_DATE
andUTC_TIMESTAMP
functions.UTC_TIME - Returns current UTC time in
HH:mm:ss
time format.UTC_DATE - Returns current UTC date in
uuuu-MM-dd
date format.UTC_TIMESTAMP - Returns current UTC Date/time in
uuuu-MM-dd HH:mm:ss
date format.Example use cases:
Issues Resolved
opensearch-project#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.