-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Feature](func) Support function UTC_DATE & UTC_TIME, and UTC_TIMESTAMP with precision #57347
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
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
zclllyybb
left a comment
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.
codes good, try add BEUT to check result
|
run buildall |
zclllyybb
left a comment
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
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
FE UT Coverage ReportIncrement line coverage |
ClickBench: Total hot run time: 28.24 s |
FE Regression Coverage ReportIncrement line coverage |
|
run beut |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
|
run buildall |
ClickBench: Total hot run time: 28.06 s |
|
run buildall |
FE Regression Coverage ReportIncrement line coverage |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
FE Regression Coverage ReportIncrement line coverage |
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
FE Regression Coverage ReportIncrement line coverage |
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
FE Regression Coverage ReportIncrement line coverage |
|
run performance |
|
PR approved by at least one committer and no changes requested. |
TPC-DS: Total hot run time: 190948 ms |
ClickBench: Total hot run time: 27.72 s |
…MP with precision (#57347) ### Release note 1. Support `UTC_TIMESTAMP` with precision ```text mysql> SELECT UTC_TIMESTAMP(5), UTC_TIMESTAMP(5) + 1; +---------------------------+----------------------+ | UTC_TIMESTAMP(5) | UTC_TIMESTAMP(5) + 1 | +---------------------------+----------------------+ | 2025-10-27 06:38:34.45620 | 20251027063835 | +---------------------------+----------------------+ mysql> SELECT UTC_TIMESTAMP(7); ERROR 1105 (HY000): errCode = 2, detailMessage = scale must be between 0 and 6 ``` 2. Support `UTC_DATE` and `UTC_TIME` ```text mysql> SELECT UTC_TIME(), UTC_TIME() + 1, UTC_TIME(6), UTC_TIME(6) + 1; ------------+----------------+-----------------+-----------------+ | UTC_TIME() | UTC_TIME() + 1 | UTC_TIME(6) | UTC_TIME(6) + 1 | +------------+----------------+-----------------+-----------------+ | 06:39:01 | 23941000001 | 06:39:01.934119 | 23941934120 | +------------+----------------+-----------------+-----------------+ mysql> SELECT UTC_TIME(7); ERROR 1105 (HY000): errCode = 2, detailMessage = scale must be between 0 and 6 mysql> SELECT UTC_DATE(); +------------+ | UTC_DATE() | +------------+ | 2025-10-27 | +------------+ ```
…MP with precision (apache#57347) ### Release note 1. Support `UTC_TIMESTAMP` with precision ```text mysql> SELECT UTC_TIMESTAMP(5), UTC_TIMESTAMP(5) + 1; +---------------------------+----------------------+ | UTC_TIMESTAMP(5) | UTC_TIMESTAMP(5) + 1 | +---------------------------+----------------------+ | 2025-10-27 06:38:34.45620 | 20251027063835 | +---------------------------+----------------------+ mysql> SELECT UTC_TIMESTAMP(7); ERROR 1105 (HY000): errCode = 2, detailMessage = scale must be between 0 and 6 ``` 2. Support `UTC_DATE` and `UTC_TIME` ```text mysql> SELECT UTC_TIME(), UTC_TIME() + 1, UTC_TIME(6), UTC_TIME(6) + 1; ------------+----------------+-----------------+-----------------+ | UTC_TIME() | UTC_TIME() + 1 | UTC_TIME(6) | UTC_TIME(6) + 1 | +------------+----------------+-----------------+-----------------+ | 06:39:01 | 23941000001 | 06:39:01.934119 | 23941934120 | +------------+----------------+-----------------+-----------------+ mysql> SELECT UTC_TIME(7); ERROR 1105 (HY000): errCode = 2, detailMessage = scale must be between 0 and 6 mysql> SELECT UTC_DATE(); +------------+ | UTC_DATE() | +------------+ | 2025-10-27 | +------------+ ```
Related PR: #57347 Before: ```text mysql> select utc_time(NULL); +----------------+ | utc_time(NULL) | +----------------+ | 00:00:00 | +----------------+ ``` After(throw error same with MySQL): ```text mysql> select utc_time(NULL); ERROR 1105 (HY000): errCode = 2, detailMessage = UTC_TIME argument cannot be NULL. ```
Related PR: #57347 Before: ```text mysql> select utc_time(NULL); +----------------+ | utc_time(NULL) | +----------------+ | 00:00:00 | +----------------+ ``` After(throw error same with MySQL): ```text mysql> select utc_time(NULL); ERROR 1105 (HY000): errCode = 2, detailMessage = UTC_TIME argument cannot be NULL. ```
Related PR: apache#57347 Before: ```text mysql> select utc_time(NULL); +----------------+ | utc_time(NULL) | +----------------+ | 00:00:00 | +----------------+ ``` After(throw error same with MySQL): ```text mysql> select utc_time(NULL); ERROR 1105 (HY000): errCode = 2, detailMessage = UTC_TIME argument cannot be NULL. ```
What problem does this PR solve?
Issue Number: #48203
Related PR: #xxx
Problem Summary:
Release note
UTC_TIMESTAMPwith precisionUTC_DATEandUTC_TIMECheck List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)