-
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
Adding UTC_DATE, UTC_TIME, UTC_TIMESTAMP #1193
Adding UTC_DATE, UTC_TIME, UTC_TIMESTAMP #1193
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1193 +/- ##
============================================
- Coverage 98.31% 95.82% -2.49%
- Complexity 3524 3536 +12
============================================
Files 342 352 +10
Lines 8711 9392 +681
Branches 555 674 +119
============================================
+ Hits 8564 9000 +436
- Misses 142 334 +192
- Partials 5 58 +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. |
Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com>
Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com>
Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com>
Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com>
Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com>
Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com>
2d48ba0
to
1462f53
Compare
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 changes!
*/ | ||
private ExprValue exprUtcTimeStamp(FunctionProperties functionProperties) { | ||
var zdt = ZonedDateTime.now(functionProperties.getQueryStartClock()) | ||
.withZoneSameInstant(ZoneId.of("UTC")); |
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.
Try using ExprTimestampValue.ZONE
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.
Try using
ExprTimestampValue.ZONE
This is supposed to be UTC all the time, isn't it?
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.
Well, what was the purpose of timezone in ExprTimestampValue
class? Was it planned as a non-static?
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.
Well, what was the purpose of timezone in
ExprTimestampValue
class? Was it planned as a non-static?
Not pretty sure. I guess it's just to avoid hardcoding :)
* Updated UTC TIME Functions for like now FunctionProperties. Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com> * Finished updates to tests. Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com> * Removed unused import. Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com> * Addressed PR comments. Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com> * Removed extra import. Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com> * removed `DateTimeFunction` used within class. Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com> Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com> (cherry picked from commit 94b6bec)
* Updated UTC TIME Functions for like now FunctionProperties. Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com> * Finished updates to tests. Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com> * Removed unused import. Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com> * Addressed PR comments. Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com> * Removed extra import. Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com> * removed `DateTimeFunction` used within class. Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com> Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com> (cherry picked from commit 94b6bec) Co-authored-by: MitchellGale-BitQuill <104795536+MitchellGale-BitQuill@users.noreply.github.com>
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
#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.