-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[opt](function) optimize from_unixtime/date_format by specially format str #40821
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. Since 2024-03-18, the Document has been moved to doris-website. |
|
run buildall |
TPC-H: Total hot run time: 42981 ms |
|
TeamCity be ut coverage result: |
TPC-DS: Total hot run time: 195149 ms |
ClickBench: Total hot run time: 31.46 s |
|
run buildall |
|
TeamCity be ut coverage result: |
TPC-H: Total hot run time: 42617 ms |
|
run performance |
TPC-H: Total hot run time: 42938 ms |
TPC-DS: Total hot run time: 194889 ms |
ClickBench: Total hot run time: 30.97 s |
| #include <variant> | ||
|
|
||
| #include "vec/common/string_ref.h" | ||
| namespace doris::vectorized { |
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.
doris::vectorized::time_format_type
| namespace time_format_type { | ||
|
|
||
| template <typename T> | ||
| void inline put_year(T y, char* buf, int& i) { |
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.
no need inline, the template func must be inline
| res_data.reserve(len * format.size + len); | ||
| null_map.resize_fill(len, false); | ||
|
|
||
| if (!format_state->is_valid) { |
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_valid should set null, is danger behavioer
|
run buildall |
TPC-H: Total hot run time: 43291 ms |
|
TeamCity be ut coverage result: |
HappenLee
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. |
|
run performance |
TPC-H: Total hot run time: 41228 ms |
TPC-DS: Total hot run time: 198385 ms |
ClickBench: Total hot run time: 33.73 s |
…t str (#40821) ``` mysql [test]>select count(date_format(a, 'yyyyMMdd')) from date_format_tmp; +-----------------------------------+ | count(date_format(a, 'yyyyMMdd')) | +-----------------------------------+ | 16000000 | +-----------------------------------+ 1 row in set (0.53 sec) mysql [test]>select count(date_format(a, 'yyyyMMdd')) from date_format_tmp; +-----------------------------------+ | count(date_format(a, 'yyyyMMdd')) | +-----------------------------------+ | 16000000 | +-----------------------------------+ 1 row in set (0.28 sec) ```
Proposed changes