-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[fix](function) fix wrong result when convert_tz is out of bound #37358
Conversation
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
run buildall |
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.
clang-tidy made some suggestions
TPC-H: Total hot run time: 39687 ms
|
TPC-DS: Total hot run time: 172666 ms
|
ClickBench: Total hot run time: 31.03 s
|
PR approved by anyone and no changes requested. |
PR approved by at least one committer and no changes requested. |
) ## Proposed changes Issue Number: close #xxx before: ```sql mysql> select CONVERT_TZ(cast('0000-01-01 00:00:00.00001' as DATETIMEV1), cast('Asia/Shanghai' as VARCHAR(65533)), cast('America/Los_Angeles' as VARCHAR(65533))); +---------------------------------------------------------------------------------------------------------------------------------------------------+ | convert_tz(cast('0000-01-01 00:00:00.00001' as DATETIME), cast('Asia/Shanghai' as VARCHAR(65533)), cast('America/Los_Angeles' as VARCHAR(65533))) | +---------------------------------------------------------------------------------------------------------------------------------------------------+ | q535-12-31 08:01:19 | +---------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.12 sec) ``` now: ```sql mysql> select CONVERT_TZ(cast('0000-01-01 00:00:00.00001' as DATETIMEV1), cast('Asia/Shanghai' as VARCHAR(65533)), cast('America/Los_Angeles' as VARCHAR(65533))); +---------------------------------------------------------------------------------------------------------------------------------------------------+ | convert_tz(cast('0000-01-01 00:00:00.00001' as DATETIME), cast('Asia/Shanghai' as VARCHAR(65533)), cast('America/Los_Angeles' as VARCHAR(65533))) | +---------------------------------------------------------------------------------------------------------------------------------------------------+ | NULL | +---------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.09 sec) ```
…che#37358) Issue Number: close #xxx before: ```sql mysql> select CONVERT_TZ(cast('0000-01-01 00:00:00.00001' as DATETIMEV1), cast('Asia/Shanghai' as VARCHAR(65533)), cast('America/Los_Angeles' as VARCHAR(65533))); +---------------------------------------------------------------------------------------------------------------------------------------------------+ | convert_tz(cast('0000-01-01 00:00:00.00001' as DATETIME), cast('Asia/Shanghai' as VARCHAR(65533)), cast('America/Los_Angeles' as VARCHAR(65533))) | +---------------------------------------------------------------------------------------------------------------------------------------------------+ | q535-12-31 08:01:19 | +---------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.12 sec) ``` now: ```sql mysql> select CONVERT_TZ(cast('0000-01-01 00:00:00.00001' as DATETIMEV1), cast('Asia/Shanghai' as VARCHAR(65533)), cast('America/Los_Angeles' as VARCHAR(65533))); +---------------------------------------------------------------------------------------------------------------------------------------------------+ | convert_tz(cast('0000-01-01 00:00:00.00001' as DATETIME), cast('Asia/Shanghai' as VARCHAR(65533)), cast('America/Los_Angeles' as VARCHAR(65533))) | +---------------------------------------------------------------------------------------------------------------------------------------------------+ | NULL | +---------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.09 sec) ```
…che#37358) ## Proposed changes Issue Number: close #xxx before: ```sql mysql> select CONVERT_TZ(cast('0000-01-01 00:00:00.00001' as DATETIMEV1), cast('Asia/Shanghai' as VARCHAR(65533)), cast('America/Los_Angeles' as VARCHAR(65533))); +---------------------------------------------------------------------------------------------------------------------------------------------------+ | convert_tz(cast('0000-01-01 00:00:00.00001' as DATETIME), cast('Asia/Shanghai' as VARCHAR(65533)), cast('America/Los_Angeles' as VARCHAR(65533))) | +---------------------------------------------------------------------------------------------------------------------------------------------------+ | q535-12-31 08:01:19 | +---------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.12 sec) ``` now: ```sql mysql> select CONVERT_TZ(cast('0000-01-01 00:00:00.00001' as DATETIMEV1), cast('Asia/Shanghai' as VARCHAR(65533)), cast('America/Los_Angeles' as VARCHAR(65533))); +---------------------------------------------------------------------------------------------------------------------------------------------------+ | convert_tz(cast('0000-01-01 00:00:00.00001' as DATETIME), cast('Asia/Shanghai' as VARCHAR(65533)), cast('America/Los_Angeles' as VARCHAR(65533))) | +---------------------------------------------------------------------------------------------------------------------------------------------------+ | NULL | +---------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.09 sec) ```
…nd (#37358) (#38313) ## Proposed changes pick #37358 before: ```sql mysql> select CONVERT_TZ(cast('0000-01-01 00:00:00.00001' as DATETIMEV1), cast('Asia/Shanghai' as VARCHAR(65533)), cast('America/Los_Angeles' as VARCHAR(65533))); +---------------------------------------------------------------------------------------------------------------------------------------------------+ | convert_tz(cast('0000-01-01 00:00:00.00001' as DATETIME), cast('Asia/Shanghai' as VARCHAR(65533)), cast('America/Los_Angeles' as VARCHAR(65533))) | +---------------------------------------------------------------------------------------------------------------------------------------------------+ | q535-12-31 08:01:19 | +---------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.12 sec) ``` now: ```sql mysql> select CONVERT_TZ(cast('0000-01-01 00:00:00.00001' as DATETIMEV1), cast('Asia/Shanghai' as VARCHAR(65533)), cast('America/Los_Angeles' as VARCHAR(65533))); +---------------------------------------------------------------------------------------------------------------------------------------------------+ | convert_tz(cast('0000-01-01 00:00:00.00001' as DATETIME), cast('Asia/Shanghai' as VARCHAR(65533)), cast('America/Los_Angeles' as VARCHAR(65533))) | +---------------------------------------------------------------------------------------------------------------------------------------------------+ | NULL | +---------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.09 sec) ```
Proposed changes
Issue Number: close #xxx
before:
now: