-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[Feature](func) Support function PERIOD_ADD and PERIOD_DIFF #56945
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:
|
c655013 to
da6b2bb
Compare
|
run buildall |
TPC-DS: Total hot run time: 190271 ms |
ClickBench: Total hot run time: 30.38 s |
FE UT Coverage ReportIncrement line coverage |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
regression-test/suites/nereids_p0/sql_functions/datetime_functions/test_date_function.groovy
Show resolved
Hide resolved
...apache/doris/nereids/trees/expressions/functions/executable/DateTimeExtractAndTransform.java
Show resolved
Hide resolved
| return std::make_shared<DataTypeInt64>(); | ||
| } | ||
|
|
||
| Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments, |
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.
这种const+nullable都要处理的,提取个基模板出来吧,估计有很多函数可以复用
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.
done.
for performance, before:
mysql> SELECT COUNT(MAKE_SET(bits, v1, v2, v3, v4, v5, v6, v7)) FROM test_make_set;
+---------------------------------------------------+
| COUNT(MAKE_SET(bits, v1, v2, v3, v4, v5, v6, v7)) |
+---------------------------------------------------+
| 100000000 |
+---------------------------------------------------+
1 row in set (25.88 sec)
after pr:
mysql> SELECT COUNT(MAKE_SET(bits, v1, v2, v3, v4, v5, v6, v7)) FROM test_make_set;
+---------------------------------------------------+
| COUNT(MAKE_SET(bits, v1, v2, v3, v4, v5, v6, v7)) |
+---------------------------------------------------+
| 100000000 |
+---------------------------------------------------+
1 row in set (20.87 sec)
f1a88c0 to
f1ea9d8
Compare
|
run buildall |
FE UT Coverage ReportIncrement line coverage |
TPC-DS: Total hot run time: 190503 ms |
ClickBench: Total hot run time: 27.76 s |
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 |
f1ea9d8 to
5f98428
Compare
0101f81 to
656efb3
Compare
656efb3 to
493e906
Compare
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. |
|
run buildall |
FE UT Coverage ReportIncrement line coverage |
TPC-DS: Total hot run time: 190836 ms |
ClickBench: Total hot run time: 27.63 s |
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 |
|
PR approved by at least one committer and no changes requested. |
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
FE Regression Coverage ReportIncrement line coverage |
…6945) ```text mysql> SELECT PERIOD_ADD(2512, 1); +---------------------+ | PERIOD_ADD(2512, 1) | +---------------------+ | 202601 | +---------------------+ mysql> SELECT PERIOD_ADD(6901, 1); +---------------------+ | PERIOD_ADD(6901, 1) | +---------------------+ | 206902 | +---------------------+ mysql> SELECT PERIOD_ADD(7001, 1); +---------------------+ | PERIOD_ADD(7001, 1) | +---------------------+ | 197002 | +---------------------+ mysql> SELECT PERIOD_DIFF(2510, 2501); +-------------------------+ | PERIOD_DIFF(2510, 2501) | +-------------------------+ | 9 | +-------------------------+ mysql> SELECT PERIOD_DIFF(2501, 2510); +-------------------------+ | PERIOD_DIFF(2501, 2510) | +-------------------------+ | -9 | +-------------------------+ ```
…6945) ```text mysql> SELECT PERIOD_ADD(2512, 1); +---------------------+ | PERIOD_ADD(2512, 1) | +---------------------+ | 202601 | +---------------------+ mysql> SELECT PERIOD_ADD(6901, 1); +---------------------+ | PERIOD_ADD(6901, 1) | +---------------------+ | 206902 | +---------------------+ mysql> SELECT PERIOD_ADD(7001, 1); +---------------------+ | PERIOD_ADD(7001, 1) | +---------------------+ | 197002 | +---------------------+ mysql> SELECT PERIOD_DIFF(2510, 2501); +-------------------------+ | PERIOD_DIFF(2510, 2501) | +-------------------------+ | 9 | +-------------------------+ mysql> SELECT PERIOD_DIFF(2501, 2510); +-------------------------+ | PERIOD_DIFF(2501, 2510) | +-------------------------+ | -9 | +-------------------------+ ```
What problem does this PR solve?
Issue Number: #48203
Related PR: #xxx
Problem Summary:
Release note
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)