You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "uchenily (via GitHub)" <gi...@apache.org> on 2025/10/23 02:57:02 UTC
[PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
uchenily opened a new pull request, #57253:
URL: https://github.com/apache/doris/pull/57253
### What problem does this PR solve?
The date_add function supports new type: `DAY_SECOND`, now we can use a string in the format 'day hour:minute:second' as the INTERVAL parameter.
```shell
mysql> select DATE_ADD('2025-10-23 10:10:10', INTERVAL '1 01:02:03' DAY_SECOND);
+-------------------------------------------------------------------+
| DATE_ADD('2025-10-23 10:10:10', INTERVAL '1 01:02:03' DAY_SECOND) |
+-------------------------------------------------------------------+
| 2025-10-24 11:12:13 |
+-------------------------------------------------------------------+
1 row in set (0.01 sec)
```
```shell
mysql> select * from datetime_table;
+---------------------+
| datetime |
+---------------------+
| 2024-01-15 10:30:00 |
| 2024-01-15 14:45:30 |
| 2024-01-15 20:15:45 |
+---------------------+
3 rows in set (0.02 sec)
mysql> select DATE_ADD(datetime, INTERVAL '1 01:02:03' DAY_SECOND) from datetime_table;
+------------------------------------------------------+
| DATE_ADD(datetime, INTERVAL '1 01:02:03' DAY_SECOND) |
+------------------------------------------------------+
| 2024-01-16 11:32:03 |
| 2024-01-16 15:47:33 |
| 2024-01-16 21:17:48 |
+------------------------------------------------------+
3 rows in set (0.01 sec)
```
Co-authored-by: codeDing18 <cs...@qq.com>
Issue Number: close #52132
Related PR: #xxx
Problem Summary:
### Release note
None
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [x] Regression test
- [ ] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [ ] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg: https://github.com/apache/doris-website/pull/1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3450283657
<details>
<summary>TPC-DS: <b>Total hot run time: 190926 ms</b></summary>
```
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 0683b0b9f1c53f3920b21d71ed4545bd725f6b09, data reload: false
query1 1095 438 400 400
query2 6573 1677 1716 1677
query3 6749 227 229 227
query4 26453 23725 23273 23273
query5 5295 647 487 487
query6 364 254 242 242
query7 4652 506 304 304
query8 337 271 260 260
query9 8738 2597 2572 2572
query10 531 319 300 300
query11 15514 15071 14839 14839
query12 189 122 115 115
query13 1676 556 427 427
query14 12574 9281 9164 9164
query15 266 195 185 185
query16 7823 677 502 502
query17 1611 813 665 665
query18 2137 491 365 365
query19 344 220 210 210
query20 144 137 148 137
query21 232 140 126 126
query22 4863 4834 4768 4768
query23 35114 33862 33917 33862
query24 8164 2464 2562 2464
query25 708 539 468 468
query26 1267 282 172 172
query27 2737 513 368 368
query28 4356 2253 2217 2217
query29 847 659 529 529
query30 310 240 205 205
query31 934 845 804 804
query32 88 82 75 75
query33 586 394 390 390
query34 856 924 571 571
query35 869 836 807 807
query36 981 1027 968 968
query37 129 113 96 96
query38 3692 3730 3487 3487
query39 1478 1422 1408 1408
query40 223 129 118 118
query41 60 60 58 58
query42 122 111 114 111
query43 504 497 486 486
query44 1212 747 732 732
query45 184 198 177 177
query46 882 994 639 639
query47 1776 1858 1729 1729
query48 403 442 333 333
query49 764 504 403 403
query50 652 686 418 418
query51 3906 4008 3968 3968
query52 113 109 105 105
query53 236 260 193 193
query54 620 589 541 541
query55 91 86 84 84
query56 309 312 325 312
query57 1205 1196 1125 1125
query58 285 286 283 283
query59 2574 2624 2584 2584
query60 350 338 328 328
query61 175 165 161 161
query62 806 723 676 676
query63 234 196 200 196
query64 4495 1181 874 874
query65 4016 3967 3957 3957
query66 1075 419 334 334
query67 15488 15417 15201 15201
query68 8836 928 593 593
query69 517 319 286 286
query70 1429 1277 1226 1226
query71 504 346 316 316
query72 5809 4916 4914 4914
query73 722 574 356 356
query74 9183 8891 9034 8891
query75 4156 3323 2889 2889
query76 3770 1157 736 736
query77 814 426 315 315
query78 9660 9666 8904 8904
query79 2317 803 603 603
query80 676 566 507 507
query81 489 259 238 238
query82 442 163 129 129
query83 300 269 251 251
query84 316 122 105 105
query85 906 478 455 455
query86 349 287 282 282
query87 3757 3721 3720 3720
query88 3265 2232 2214 2214
query89 383 324 307 307
query90 2044 211 212 211
query91 205 172 143 143
query92 83 72 68 68
query93 1235 980 644 644
query94 704 454 336 336
query95 405 329 312 312
query96 487 573 277 277
query97 2975 2970 2898 2898
query98 250 212 221 212
query99 1471 1430 1326 1326
Total cold run time: 282495 ms
Total hot run time: 190926 ms
```
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3450400935
# FE UT Coverage Report
Increment line coverage ` 51.35% (19/37)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/57253_0683b0b9f1c53f3920b21d71ed4545bd725f6b09/fe_increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/57253_0683b0b9f1c53f3920b21d71ed4545bd725f6b09/fe_report/index.html)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3440943703
# FE Regression Coverage Report
Increment line coverage ` 83.78% (31/37)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/57253_f7b7cce38d3d585232b5c84417754a00a2e78da2_merge_fe/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/57253_f7b7cce38d3d585232b5c84417754a00a2e78da2_merge_fe/report/index.html)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "uchenily (via GitHub)" <gi...@apache.org>.
uchenily commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3450694255
run buildall
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3460926847
# BE UT Coverage Report
Increment line coverage `45.38% (54/119)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/7f29751805f2c76fee84ae25f1c1790d83259a4b_7f29751805f2c76fee84ae25f1c1790d83259a4b/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/7f29751805f2c76fee84ae25f1c1790d83259a4b_7f29751805f2c76fee84ae25f1c1790d83259a4b/report/index.html)
| Category | Coverage |
|-------------------|--------------------|
| Function Coverage | 52.76% (18069/34246) |
| Line Coverage | 38.00% (163894/431300) |
| Region Coverage | 32.35% (124852/385882) |
| Branch Coverage | 33.73% (54624/161949) |
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "zclllyybb (via GitHub)" <gi...@apache.org>.
zclllyybb commented on code in PR #57253:
URL: https://github.com/apache/doris/pull/57253#discussion_r2462993477
##########
be/src/vec/functions/function_date_or_datetime_computation.h:
##########
@@ -580,10 +617,72 @@ class FunctionDateOrDateTimeComputation : public IFunction {
// vector-const
if (const auto* nest_col1_const = check_and_get_column<ColumnConst>(*nest_col1)) {
rconst = true;
- const auto col1_inside_const =
- assert_cast<const IntervalColumnType&>(nest_col1_const->get_data_column());
- Op::vector_constant(sources->get_data(), res_col->get_data(),
- col1_inside_const.get_data()[0], nullmap0, nullmap1);
+ if constexpr (Transform::IntervalPRealType == TYPE_STRING) {
Review Comment:
the specific calculation logic shouldn't put here. should in `Op`.
##########
be/src/vec/functions/function_date_or_datetime_computation.h:
##########
@@ -580,10 +617,72 @@ class FunctionDateOrDateTimeComputation : public IFunction {
// vector-const
if (const auto* nest_col1_const = check_and_get_column<ColumnConst>(*nest_col1)) {
rconst = true;
- const auto col1_inside_const =
- assert_cast<const IntervalColumnType&>(nest_col1_const->get_data_column());
- Op::vector_constant(sources->get_data(), res_col->get_data(),
- col1_inside_const.get_data()[0], nullmap0, nullmap1);
+ if constexpr (Transform::IntervalPRealType == TYPE_STRING) {
+ StringRef time_str = nest_col1_const->get_data_at(0).trim();
Review Comment:
ignore this
##########
be/src/vec/functions/function_date_or_datetime_computation_v2.cpp:
##########
@@ -26,6 +26,7 @@ using FunctionAddWeeksV2 = FunctionDateOrDateTimeComputation<AddWeeksImpl<TYPE_D
using FunctionAddMonthsV2 = FunctionDateOrDateTimeComputation<AddMonthsImpl<TYPE_DATEV2>>;
using FunctionAddQuartersV2 = FunctionDateOrDateTimeComputation<AddQuartersImpl<TYPE_DATEV2>>;
using FunctionAddYearsV2 = FunctionDateOrDateTimeComputation<AddYearsImpl<TYPE_DATEV2>>;
+using FunctionAddDaySecondV2 = FunctionDateOrDateTimeComputation<AddDaySecondImpl<TYPE_DATEV2>>;
Review Comment:
you dont have this signature, please remove
##########
regression-test/suites/query_p0/sql_functions/datetime_functions/test_dateadd_with_other_timeunit.groovy:
##########
@@ -0,0 +1,57 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+import java.text.SimpleDateFormat
+
+suite("test_dateadd_with_other_timeunit") {
+ def tableName = "test_date_add_with_other_timeunit"
+
+ sql """ DROP TABLE IF EXISTS ${tableName} """
+ sql """
+ CREATE TABLE IF NOT EXISTS ${tableName} (
+ test_datetime datetime NULL COMMENT "",
+ test_date date NULL COMMENT ""
+ ) ENGINE=OLAP
+ DUPLICATE KEY(test_datetime)
+ COMMENT "OLAP"
+ DISTRIBUTED BY HASH(test_datetime) BUCKETS 1
+ PROPERTIES (
+ "replication_allocation" = "tag.location.default: 1",
+ "in_memory" = "false",
+ "storage_format" = "V2"
+ )
+ """
+ sql """ insert into ${tableName} values ("2019-08-01 13:21:03", "2025-09-08") """
+
+ qt_sql """ select date_add("2019-08-01 13:21:03", INTERVAL "1 1:1:1" DAY_SECOND); """
Review Comment:
also use `testFoldConst` to ensure consistency of execution result in BE and FE
##########
be/src/vec/functions/function_date_or_datetime_computation.h:
##########
@@ -124,11 +127,34 @@ ADD_TIME_FUNCTION_IMPL(AddWeeksImpl, weeks_add, WEEK);
ADD_TIME_FUNCTION_IMPL(AddMonthsImpl, months_add, MONTH);
ADD_TIME_FUNCTION_IMPL(AddYearsImpl, years_add, YEAR);
+template <PrimitiveType PType>
+struct AddDaySecondImpl {
+ static constexpr PrimitiveType ArgPType = PType;
+ static constexpr PrimitiveType ReturnType = PType;
+ static constexpr PrimitiveType IntervalPType = PrimitiveType ::TYPE_INT;
+ static constexpr PrimitiveType IntervalPRealType = TYPE_STRING;
Review Comment:
this problem is easy to resolve——add requires clause to functions in DateTimeOp to specific if it should exist depending on template argument.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3454126377
<details>
<summary>TPC-DS: <b>Total hot run time: 190182 ms</b></summary>
```
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 845a0bc418dc5862dd1a4714a7e31bc8b989c02c, data reload: false
query1 1077 408 404 404
query2 6577 1677 1681 1677
query3 6753 223 221 221
query4 26401 23863 23324 23324
query5 5163 647 486 486
query6 350 268 238 238
query7 4670 505 302 302
query8 355 285 270 270
query9 8701 2581 2604 2581
query10 540 345 293 293
query11 15405 15140 14812 14812
query12 187 118 113 113
query13 1681 573 432 432
query14 11617 9254 9286 9254
query15 205 193 179 179
query16 7678 688 517 517
query17 1631 798 654 654
query18 2058 493 347 347
query19 244 234 215 215
query20 141 139 131 131
query21 222 143 146 143
query22 4677 4723 4453 4453
query23 35033 34285 33963 33963
query24 8421 2642 2468 2468
query25 597 531 474 474
query26 1273 294 174 174
query27 2888 542 372 372
query28 5725 2285 2244 2244
query29 812 673 561 561
query30 401 244 208 208
query31 976 848 802 802
query32 89 68 78 68
query33 602 408 373 373
query34 837 896 552 552
query35 852 882 789 789
query36 1010 1021 948 948
query37 122 110 88 88
query38 3652 3759 3467 3467
query39 1456 1441 1414 1414
query40 223 124 133 124
query41 64 60 62 60
query42 120 115 112 112
query43 483 511 469 469
query44 1216 748 734 734
query45 184 178 175 175
query46 873 997 630 630
query47 1777 1804 1727 1727
query48 388 428 318 318
query49 785 493 426 426
query50 634 690 429 429
query51 3918 3910 3826 3826
query52 110 107 103 103
query53 234 263 198 198
query54 606 599 546 546
query55 95 88 81 81
query56 341 329 328 328
query57 1206 1214 1136 1136
query58 286 288 274 274
query59 2571 2592 2576 2576
query60 337 343 325 325
query61 165 163 158 158
query62 794 742 696 696
query63 240 199 191 191
query64 4482 1192 889 889
query65 4115 3944 3944 3944
query66 1078 439 340 340
query67 15113 15278 15134 15134
query68 8493 871 598 598
query69 515 359 301 301
query70 1359 1293 1304 1293
query71 514 347 325 325
query72 6020 4861 4798 4798
query73 672 569 368 368
query74 8928 9131 8664 8664
query75 4133 3335 2825 2825
query76 3793 1153 729 729
query77 862 405 317 317
query78 9575 9762 8909 8909
query79 2012 831 597 597
query80 655 580 505 505
query81 515 258 226 226
query82 446 165 137 137
query83 285 283 248 248
query84 258 112 102 102
query85 917 493 461 461
query86 342 308 282 282
query87 3783 3771 3621 3621
query88 3660 2279 2244 2244
query89 400 334 302 302
query90 2034 222 213 213
query91 170 169 139 139
query92 85 71 69 69
query93 1602 979 642 642
query94 697 424 319 319
query95 407 327 317 317
query96 498 573 281 281
query97 2913 2969 2859 2859
query98 244 215 214 214
query99 1676 1402 1317 1317
Total cold run time: 281980 ms
Total hot run time: 190182 ms
```
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "uchenily (via GitHub)" <gi...@apache.org>.
uchenily commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3460137335
run buildall
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3461227486
# BE Regression && UT Coverage Report
Increment line coverage `94.12% (112/119)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/57253_7f29751805f2c76fee84ae25f1c1790d83259a4b_merge/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/57253_7f29751805f2c76fee84ae25f1c1790d83259a4b_merge/report/index.html)
| Category | Coverage |
|-------------------|--------------------|
| Function Coverage | 71.37% (23946/33551) |
| Line Coverage | 57.84% (249337/431112) |
| Region Coverage | 52.99% (207010/390644) |
| Branch Coverage | 54.68% (88988/162732) |
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "uchenily (via GitHub)" <gi...@apache.org>.
uchenily commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3460632494
run buildall
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3462353673
# BE Regression && UT Coverage Report
Increment line coverage `94.12% (112/119)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/57253_7f29751805f2c76fee84ae25f1c1790d83259a4b_merge/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/57253_7f29751805f2c76fee84ae25f1c1790d83259a4b_merge/report/index.html)
| Category | Coverage |
|-------------------|--------------------|
| Function Coverage | 71.37% (23946/33551) |
| Line Coverage | 57.84% (249340/431112) |
| Region Coverage | 53.03% (207145/390644) |
| Branch Coverage | 54.70% (89011/162732) |
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3449976192
# FE Regression Coverage Report
Increment line coverage ` 81.08% (30/37)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/57253_4ea2174d91e5172e2760056b2f0ab1b1cf2505ce_merge_fe/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/57253_4ea2174d91e5172e2760056b2f0ab1b1cf2505ce_merge_fe/report/index.html)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3459923777
# BE Regression && UT Coverage Report
Increment line coverage `93.64% (103/110)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/57253_845a0bc418dc5862dd1a4714a7e31bc8b989c02c_merge/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/57253_845a0bc418dc5862dd1a4714a7e31bc8b989c02c_merge/report/index.html)
| Category | Coverage |
|-------------------|--------------------|
| Function Coverage | 71.38% (23934/33529) |
| Line Coverage | 57.80% (248942/430725) |
| Region Coverage | 52.90% (206404/390199) |
| Branch Coverage | 54.59% (88703/162500) |
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3440882953
# BE Regression && UT Coverage Report
Increment line coverage `74.24% (49/66)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/57253_f7b7cce38d3d585232b5c84417754a00a2e78da2_merge/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/57253_f7b7cce38d3d585232b5c84417754a00a2e78da2_merge/report/index.html)
| Category | Coverage |
|-------------------|--------------------|
| Function Coverage | 71.32% (23875/33474) |
| Line Coverage | 57.74% (248488/430364) |
| Region Coverage | 52.75% (205658/389864) |
| Branch Coverage | 54.54% (88606/162452) |
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3434960638
<details>
<summary>ClickBench: <b>Total hot run time: 27.57 s</b></summary>
```
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit b637a6f129e9590b4f0c122144dfaad95e1eb16a, data reload: false
query1 0.06 0.06 0.05
query2 0.09 0.05 0.05
query3 0.26 0.09 0.08
query4 1.62 0.12 0.14
query5 0.28 0.26 0.24
query6 1.18 0.66 0.64
query7 0.03 0.02 0.02
query8 0.05 0.04 0.04
query9 0.62 0.53 0.53
query10 0.60 0.60 0.59
query11 0.17 0.12 0.14
query12 0.16 0.12 0.13
query13 0.64 0.61 0.59
query14 1.02 1.02 1.01
query15 0.85 0.86 0.87
query16 0.40 0.39 0.39
query17 1.05 1.09 1.03
query18 0.24 0.21 0.20
query19 1.87 1.82 1.83
query20 0.02 0.02 0.02
query21 15.42 0.19 0.13
query22 5.03 0.08 0.05
query23 15.70 0.26 0.11
query24 2.78 0.70 0.30
query25 0.08 0.08 0.07
query26 0.15 0.13 0.14
query27 0.07 0.06 0.06
query28 4.19 1.15 0.93
query29 12.57 4.01 3.29
query30 0.29 0.14 0.11
query31 2.82 0.61 0.39
query32 3.24 0.56 0.48
query33 2.98 3.05 3.13
query34 15.82 5.17 4.52
query35 4.59 4.55 4.57
query36 0.67 0.50 0.49
query37 0.11 0.07 0.07
query38 0.07 0.05 0.04
query39 0.04 0.03 0.03
query40 0.17 0.16 0.14
query41 0.08 0.04 0.04
query42 0.05 0.03 0.03
query43 0.05 0.04 0.04
Total cold run time: 98.18 s
Total hot run time: 27.57 s
```
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3435655917
# BE Regression && UT Coverage Report
Increment line coverage `74.24% (49/66)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/57253_b637a6f129e9590b4f0c122144dfaad95e1eb16a_merge/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/57253_b637a6f129e9590b4f0c122144dfaad95e1eb16a_merge/report/index.html)
| Category | Coverage |
|-------------------|--------------------|
| Function Coverage | 71.44% (23895/33449) |
| Line Coverage | 57.85% (248677/429865) |
| Region Coverage | 52.89% (206053/389615) |
| Branch Coverage | 54.72% (88840/162347) |
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "codeDing18 (via GitHub)" <gi...@apache.org>.
codeDing18 commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3454693447
run nonConcurrent
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3465937719
PR approved by at least one committer and no changes requested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3436280406
# BE UT Coverage Report
Increment line coverage `9.09% (6/66)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/105c9a09cb0cc2fe2259bea9917d9c6dce438c35_105c9a09cb0cc2fe2259bea9917d9c6dce438c35/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/105c9a09cb0cc2fe2259bea9917d9c6dce438c35_105c9a09cb0cc2fe2259bea9917d9c6dce438c35/report/index.html)
| Category | Coverage |
|-------------------|--------------------|
| Function Coverage | 52.62% (17940/34091) |
| Line Coverage | 37.85% (162764/430001) |
| Region Coverage | 32.28% (124134/384596) |
| Branch Coverage | 33.67% (54365/161461) |
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3436548277
# FE Regression Coverage Report
Increment line coverage ` 83.78% (31/37)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/57253_105c9a09cb0cc2fe2259bea9917d9c6dce438c35_merge_fe/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/57253_105c9a09cb0cc2fe2259bea9917d9c6dce438c35_merge_fe/report/index.html)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "codeDing18 (via GitHub)" <gi...@apache.org>.
codeDing18 commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3441145914
run nonConcurrent
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "codeDing18 (via GitHub)" <gi...@apache.org>.
codeDing18 commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3449653877
run beut
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3454695476
# FE Regression Coverage Report
Increment line coverage ` 83.78% (31/37)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/57253_845a0bc418dc5862dd1a4714a7e31bc8b989c02c_merge_fe/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/57253_845a0bc418dc5862dd1a4714a7e31bc8b989c02c_merge_fe/report/index.html)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "zclllyybb (via GitHub)" <gi...@apache.org>.
zclllyybb commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3459511925
run beut
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "uchenily (via GitHub)" <gi...@apache.org>.
uchenily commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3460150229
run buildall
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "uchenily (via GitHub)" <gi...@apache.org>.
uchenily commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3450115635
run buildall
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3435003902
# BE UT Coverage Report
Increment line coverage `9.09% (6/66)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/b637a6f129e9590b4f0c122144dfaad95e1eb16a_b637a6f129e9590b4f0c122144dfaad95e1eb16a/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/b637a6f129e9590b4f0c122144dfaad95e1eb16a_b637a6f129e9590b4f0c122144dfaad95e1eb16a/report/index.html)
| Category | Coverage |
|-------------------|--------------------|
| Function Coverage | 52.65% (17935/34067) |
| Line Coverage | 37.88% (162716/429534) |
| Region Coverage | 32.27% (124039/384352) |
| Branch Coverage | 33.70% (54376/161362) |
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "codeDing18 (via GitHub)" <gi...@apache.org>.
codeDing18 commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3435280133
run cloud_p0
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "uchenily (via GitHub)" <gi...@apache.org>.
uchenily commented on code in PR #57253:
URL: https://github.com/apache/doris/pull/57253#discussion_r2454205738
##########
be/src/vec/functions/function_date_or_datetime_computation.h:
##########
@@ -124,11 +127,34 @@ ADD_TIME_FUNCTION_IMPL(AddWeeksImpl, weeks_add, WEEK);
ADD_TIME_FUNCTION_IMPL(AddMonthsImpl, months_add, MONTH);
ADD_TIME_FUNCTION_IMPL(AddYearsImpl, years_add, YEAR);
+template <PrimitiveType PType>
+struct AddDaySecondImpl {
+ static constexpr PrimitiveType ArgPType = PType;
+ static constexpr PrimitiveType ReturnType = PType;
+ static constexpr PrimitiveType IntervalPType = PrimitiveType ::TYPE_INT;
+ static constexpr PrimitiveType IntervalPRealType = TYPE_STRING;
Review Comment:
This is actually a compromise solution. We introduced the IntervalPRealType field to handle cases like AddDaySecondImpl where the delta value passed during the execution of the execute method requires type conversion (StringRef → Integer). (So we cannot directly use the `ADD_TIME_FUNCTION_IMPL` macro to generate the code).
If we hadn't introduced the `IntervalPRealType` field and instead set `IntervalPType = TYPE_STRING`, then in `FunctionDateOrDateTimeComputation::execute_impl`, we would need to handle TYPE_STRING cases for all three scenarios: vector-vector, vector-const, and const-vector. While the vector-const scenario would be simple to handle, but handling other scenarios will be complex, as we would need to modify all execute methods to support the TYPE_STRING type.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3440523885
# BE UT Coverage Report
Increment line coverage `9.09% (6/66)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/f7b7cce38d3d585232b5c84417754a00a2e78da2_f7b7cce38d3d585232b5c84417754a00a2e78da2/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/f7b7cce38d3d585232b5c84417754a00a2e78da2_f7b7cce38d3d585232b5c84417754a00a2e78da2/report/index.html)
| Category | Coverage |
|-------------------|--------------------|
| Function Coverage | 52.63% (17941/34092) |
| Line Coverage | 37.85% (162768/430013) |
| Region Coverage | 32.27% (124119/384597) |
| Branch Coverage | 33.67% (54365/161461) |
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "linrrzqqq (via GitHub)" <gi...@apache.org>.
linrrzqqq commented on code in PR #57253:
URL: https://github.com/apache/doris/pull/57253#discussion_r2471901060
##########
be/src/vec/functions/function_date_or_datetime_computation.h:
##########
@@ -125,6 +126,88 @@ ADD_TIME_FUNCTION_IMPL(AddWeeksImpl, weeks_add, WEEK);
ADD_TIME_FUNCTION_IMPL(AddMonthsImpl, months_add, MONTH);
ADD_TIME_FUNCTION_IMPL(AddYearsImpl, years_add, YEAR);
+template <PrimitiveType PType>
+struct AddDaySecondImpl {
+ static constexpr PrimitiveType ArgPType = PType;
+ static constexpr PrimitiveType ReturnType = PType;
+ static constexpr PrimitiveType IntervalPType = PrimitiveType ::TYPE_STRING;
+ using InputNativeType = typename PrimitiveTypeTraits<PType>::DataType ::FieldType;
+ using ReturnNativeType = InputNativeType;
+ using IntervalDataType = typename PrimitiveTypeTraits<IntervalPType>::DataType;
+ using IntervalNativeType = IntervalDataType::FieldType; // string
+ using ConvertedType = typename PrimitiveTypeTraits<TYPE_BIGINT>::DataType::FieldType;
+
+ static constexpr auto name = "day_second_add";
+ static constexpr auto is_nullable = false;
+
+ static inline ReturnNativeType execute(const InputNativeType& t, IntervalNativeType delta) {
+ long seconds = parse_time_string_to_seconds(delta);
+ return date_time_add<TimeUnit::SECOND, PType, ConvertedType>(t, seconds);
+ }
+
+ static DataTypes get_variadic_argument_types() {
+ return {std ::make_shared<typename PrimitiveTypeTraits<PType>::DataType>(),
+ std ::make_shared<typename PrimitiveTypeTraits<IntervalPType>::DataType>()};
+ }
+
+ static long parse_time_string_to_seconds(IntervalNativeType time_str_ref) {
+ auto time_str = StringRef {time_str_ref.data(), time_str_ref.length()}.trim();
+ // string format: "d h:m:s"
+ size_t space_pos = time_str.find_first_of(' ');
+ if (space_pos == std::string::npos) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT,
+ "Invalid time format, missing space in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ // day
+ StringRef days_sub = time_str.substring(0, space_pos).trim();
+ StringParser::ParseResult success;
+ int days = StringParser::string_to_int_internal<int32_t, true>(days_sub.data, days_sub.size,
+ &success);
+ if (success != StringParser::PARSE_SUCCESS) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid days format in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ // hour:minute:second
+ StringRef time_hour_str = time_str.substring(space_pos + 1);
+ size_t colon1 = time_hour_str.find_first_of(':');
+ if (colon1 == std::string::npos) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid time format, missing ':' in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ size_t colon2_rel = time_hour_str.substring(colon1 + 1).find_first_of(':');
+ size_t colon2 =
+ (colon2_rel != std::string::npos) ? colon1 + 1 + colon2_rel : std::string::npos;
+ if (colon2 == std::string::npos) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid time format, missing ':' in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ StringRef hours_sub = time_hour_str.substring(0, colon1).trim();
+ int hours = StringParser::string_to_int_internal<int32_t, true>(hours_sub.data,
+ hours_sub.size, &success);
+ if (success != StringParser::PARSE_SUCCESS) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid hours format in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ StringRef minutes_sub = time_hour_str.substring(colon1 + 1, colon2 - colon1 - 1).trim();
+ int minutes = StringParser::string_to_int_internal<int32_t, true>(
+ minutes_sub.data, minutes_sub.size, &success);
+ if (success != StringParser::PARSE_SUCCESS) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid minutes format in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ StringRef seconds_sub = time_hour_str.substring(colon2 + 1).trim();
+ int seconds = StringParser::string_to_int_internal<int32_t, true>(
+ seconds_sub.data, seconds_sub.size, &success);
+ if (success != StringParser::PARSE_SUCCESS) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid seconds format in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+
+ return days * 24 * 3600 + hours * 3600 + minutes * 60 + seconds;
Review Comment:
just solve in this pr
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3460802532
<details>
<summary>ClickBench: <b>Total hot run time: 29.15 s</b></summary>
```
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 7f29751805f2c76fee84ae25f1c1790d83259a4b, data reload: false
query1 0.06 0.06 0.06
query2 0.10 0.06 0.06
query3 0.26 0.09 0.10
query4 1.62 0.12 0.14
query5 0.30 0.28 0.27
query6 1.18 0.69 0.68
query7 0.04 0.03 0.02
query8 0.06 0.05 0.05
query9 0.66 0.59 0.58
query10 0.63 0.62 0.64
query11 0.20 0.13 0.14
query12 0.19 0.14 0.15
query13 0.64 0.65 0.62
query14 1.04 1.03 1.04
query15 0.95 0.90 0.91
query16 0.41 0.42 0.46
query17 1.17 1.25 1.13
query18 0.23 0.23 0.22
query19 2.06 1.94 1.99
query20 0.02 0.01 0.02
query21 15.37 0.20 0.14
query22 5.08 0.08 0.05
query23 15.61 0.31 0.12
query24 2.91 0.64 0.49
query25 0.10 0.08 0.07
query26 0.18 0.15 0.17
query27 0.07 0.05 0.07
query28 3.93 1.19 0.96
query29 12.62 4.57 3.73
query30 0.31 0.15 0.12
query31 2.83 0.65 0.42
query32 3.25 0.57 0.49
query33 3.18 3.14 3.19
query34 15.90 5.25 4.61
query35 4.69 4.67 4.60
query36 0.69 0.54 0.52
query37 0.12 0.07 0.08
query38 0.08 0.05 0.05
query39 0.04 0.03 0.03
query40 0.18 0.16 0.15
query41 0.10 0.04 0.03
query42 0.04 0.03 0.04
query43 0.05 0.04 0.04
Total cold run time: 99.15 s
Total hot run time: 29.15 s
```
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "zclllyybb (via GitHub)" <gi...@apache.org>.
zclllyybb merged PR #57253:
URL: https://github.com/apache/doris/pull/57253
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3435682067
# FE Regression Coverage Report
Increment line coverage ` 27.03% (10/37)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/57253_b637a6f129e9590b4f0c122144dfaad95e1eb16a_merge_fe/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/57253_b637a6f129e9590b4f0c122144dfaad95e1eb16a_merge_fe/report/index.html)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3436159234
# FE UT Coverage Report
Increment line coverage ` 51.35% (19/37)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/57253_105c9a09cb0cc2fe2259bea9917d9c6dce438c35/fe_increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/57253_105c9a09cb0cc2fe2259bea9917d9c6dce438c35/fe_report/index.html)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "codeDing18 (via GitHub)" <gi...@apache.org>.
codeDing18 commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3435279900
run p0
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "codeDing18 (via GitHub)" <gi...@apache.org>.
codeDing18 commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3435279692
run feut
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "uchenily (via GitHub)" <gi...@apache.org>.
uchenily commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3449559503
run buildall
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3450880324
<details>
<summary>ClickBench: <b>Total hot run time: 28.13 s</b></summary>
```
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit a9f765ee1c046acd1071c06b90d8f29ba84933d8, data reload: false
query1 0.06 0.05 0.05
query2 0.10 0.06 0.06
query3 0.26 0.09 0.08
query4 1.62 0.12 0.13
query5 0.28 0.27 0.26
query6 1.18 0.65 0.66
query7 0.03 0.02 0.03
query8 0.06 0.05 0.04
query9 0.62 0.54 0.53
query10 0.59 0.60 0.61
query11 0.17 0.12 0.12
query12 0.16 0.12 0.12
query13 0.63 0.62 0.60
query14 1.01 1.02 1.00
query15 0.86 0.84 0.85
query16 0.42 0.40 0.44
query17 1.01 1.06 1.04
query18 0.23 0.22 0.21
query19 1.92 1.84 1.80
query20 0.02 0.02 0.01
query21 15.43 0.20 0.15
query22 5.01 0.07 0.05
query23 15.65 0.28 0.11
query24 3.07 0.62 0.55
query25 0.09 0.06 0.06
query26 0.15 0.14 0.14
query27 0.07 0.06 0.06
query28 4.43 1.16 0.93
query29 12.63 4.17 3.48
query30 0.29 0.15 0.12
query31 2.82 0.61 0.39
query32 3.26 0.58 0.48
query33 3.06 3.09 3.08
query34 15.93 5.13 4.55
query35 4.66 4.55 4.56
query36 0.69 0.52 0.51
query37 0.11 0.07 0.07
query38 0.07 0.05 0.04
query39 0.04 0.04 0.03
query40 0.19 0.16 0.14
query41 0.09 0.03 0.04
query42 0.05 0.03 0.03
query43 0.05 0.04 0.03
Total cold run time: 99.07 s
Total hot run time: 28.13 s
```
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "codeDing18 (via GitHub)" <gi...@apache.org>.
codeDing18 commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3434893165
run buildall
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "uchenily (via GitHub)" <gi...@apache.org>.
uchenily commented on code in PR #57253:
URL: https://github.com/apache/doris/pull/57253#discussion_r2454349868
##########
regression-test/suites/query_p0/sql_functions/datetime_functions/test_date_function.groovy:
##########
Review Comment:
done, we add new regression tests in regression-test/suites/query_p0/sql_functions/datetime_functions/test_dateadd_with_other_timeunit.groovy
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "uchenily (via GitHub)" <gi...@apache.org>.
uchenily commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3440198709
run buildall
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "codeDing18 (via GitHub)" <gi...@apache.org>.
codeDing18 commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3440648532
run feut
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3459493561
PR approved by at least one committer and no changes requested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "zclllyybb (via GitHub)" <gi...@apache.org>.
zclllyybb commented on code in PR #57253:
URL: https://github.com/apache/doris/pull/57253#discussion_r2471928591
##########
be/src/vec/functions/function_date_or_datetime_computation.h:
##########
@@ -125,6 +126,88 @@ ADD_TIME_FUNCTION_IMPL(AddWeeksImpl, weeks_add, WEEK);
ADD_TIME_FUNCTION_IMPL(AddMonthsImpl, months_add, MONTH);
ADD_TIME_FUNCTION_IMPL(AddYearsImpl, years_add, YEAR);
+template <PrimitiveType PType>
+struct AddDaySecondImpl {
+ static constexpr PrimitiveType ArgPType = PType;
+ static constexpr PrimitiveType ReturnType = PType;
+ static constexpr PrimitiveType IntervalPType = PrimitiveType ::TYPE_STRING;
+ using InputNativeType = typename PrimitiveTypeTraits<PType>::DataType ::FieldType;
+ using ReturnNativeType = InputNativeType;
+ using IntervalDataType = typename PrimitiveTypeTraits<IntervalPType>::DataType;
+ using IntervalNativeType = IntervalDataType::FieldType; // string
+ using ConvertedType = typename PrimitiveTypeTraits<TYPE_BIGINT>::DataType::FieldType;
+
+ static constexpr auto name = "day_second_add";
+ static constexpr auto is_nullable = false;
+
+ static inline ReturnNativeType execute(const InputNativeType& t, IntervalNativeType delta) {
+ long seconds = parse_time_string_to_seconds(delta);
+ return date_time_add<TimeUnit::SECOND, PType, ConvertedType>(t, seconds);
+ }
+
+ static DataTypes get_variadic_argument_types() {
+ return {std ::make_shared<typename PrimitiveTypeTraits<PType>::DataType>(),
+ std ::make_shared<typename PrimitiveTypeTraits<IntervalPType>::DataType>()};
+ }
+
+ static long parse_time_string_to_seconds(IntervalNativeType time_str_ref) {
+ auto time_str = StringRef {time_str_ref.data(), time_str_ref.length()}.trim();
+ // string format: "d h:m:s"
+ size_t space_pos = time_str.find_first_of(' ');
+ if (space_pos == std::string::npos) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT,
+ "Invalid time format, missing space in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ // day
+ StringRef days_sub = time_str.substring(0, space_pos).trim();
+ StringParser::ParseResult success;
+ int days = StringParser::string_to_int_internal<int32_t, true>(days_sub.data, days_sub.size,
+ &success);
+ if (success != StringParser::PARSE_SUCCESS) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid days format in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ // hour:minute:second
+ StringRef time_hour_str = time_str.substring(space_pos + 1);
+ size_t colon1 = time_hour_str.find_first_of(':');
+ if (colon1 == std::string::npos) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid time format, missing ':' in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ size_t colon2_rel = time_hour_str.substring(colon1 + 1).find_first_of(':');
+ size_t colon2 =
+ (colon2_rel != std::string::npos) ? colon1 + 1 + colon2_rel : std::string::npos;
+ if (colon2 == std::string::npos) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid time format, missing ':' in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ StringRef hours_sub = time_hour_str.substring(0, colon1).trim();
+ int hours = StringParser::string_to_int_internal<int32_t, true>(hours_sub.data,
+ hours_sub.size, &success);
+ if (success != StringParser::PARSE_SUCCESS) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid hours format in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ StringRef minutes_sub = time_hour_str.substring(colon1 + 1, colon2 - colon1 - 1).trim();
+ int minutes = StringParser::string_to_int_internal<int32_t, true>(
+ minutes_sub.data, minutes_sub.size, &success);
+ if (success != StringParser::PARSE_SUCCESS) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid minutes format in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ StringRef seconds_sub = time_hour_str.substring(colon2 + 1).trim();
+ int seconds = StringParser::string_to_int_internal<int32_t, true>(
+ seconds_sub.data, seconds_sub.size, &success);
+ if (success != StringParser::PARSE_SUCCESS) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid seconds format in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+
+ return days * 24 * 3600 + hours * 3600 + minutes * 60 + seconds;
Review Comment:
@uchenily well, I think they're important diff. It would be better if fix in this PR and add solid cases to coverage
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "uchenily (via GitHub)" <gi...@apache.org>.
uchenily commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3454026239
run buildall
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "linrrzqqq (via GitHub)" <gi...@apache.org>.
linrrzqqq commented on code in PR #57253:
URL: https://github.com/apache/doris/pull/57253#discussion_r2471729057
##########
be/src/vec/functions/function_date_or_datetime_computation.h:
##########
@@ -125,6 +126,88 @@ ADD_TIME_FUNCTION_IMPL(AddWeeksImpl, weeks_add, WEEK);
ADD_TIME_FUNCTION_IMPL(AddMonthsImpl, months_add, MONTH);
ADD_TIME_FUNCTION_IMPL(AddYearsImpl, years_add, YEAR);
+template <PrimitiveType PType>
+struct AddDaySecondImpl {
+ static constexpr PrimitiveType ArgPType = PType;
+ static constexpr PrimitiveType ReturnType = PType;
+ static constexpr PrimitiveType IntervalPType = PrimitiveType ::TYPE_STRING;
+ using InputNativeType = typename PrimitiveTypeTraits<PType>::DataType ::FieldType;
+ using ReturnNativeType = InputNativeType;
+ using IntervalDataType = typename PrimitiveTypeTraits<IntervalPType>::DataType;
+ using IntervalNativeType = IntervalDataType::FieldType; // string
+ using ConvertedType = typename PrimitiveTypeTraits<TYPE_BIGINT>::DataType::FieldType;
+
+ static constexpr auto name = "day_second_add";
+ static constexpr auto is_nullable = false;
+
+ static inline ReturnNativeType execute(const InputNativeType& t, IntervalNativeType delta) {
+ long seconds = parse_time_string_to_seconds(delta);
+ return date_time_add<TimeUnit::SECOND, PType, ConvertedType>(t, seconds);
+ }
+
+ static DataTypes get_variadic_argument_types() {
+ return {std ::make_shared<typename PrimitiveTypeTraits<PType>::DataType>(),
+ std ::make_shared<typename PrimitiveTypeTraits<IntervalPType>::DataType>()};
+ }
+
+ static long parse_time_string_to_seconds(IntervalNativeType time_str_ref) {
+ auto time_str = StringRef {time_str_ref.data(), time_str_ref.length()}.trim();
+ // string format: "d h:m:s"
+ size_t space_pos = time_str.find_first_of(' ');
+ if (space_pos == std::string::npos) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT,
+ "Invalid time format, missing space in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ // day
+ StringRef days_sub = time_str.substring(0, space_pos).trim();
+ StringParser::ParseResult success;
+ int days = StringParser::string_to_int_internal<int32_t, true>(days_sub.data, days_sub.size,
+ &success);
+ if (success != StringParser::PARSE_SUCCESS) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid days format in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ // hour:minute:second
+ StringRef time_hour_str = time_str.substring(space_pos + 1);
+ size_t colon1 = time_hour_str.find_first_of(':');
+ if (colon1 == std::string::npos) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid time format, missing ':' in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ size_t colon2_rel = time_hour_str.substring(colon1 + 1).find_first_of(':');
+ size_t colon2 =
+ (colon2_rel != std::string::npos) ? colon1 + 1 + colon2_rel : std::string::npos;
+ if (colon2 == std::string::npos) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid time format, missing ':' in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ StringRef hours_sub = time_hour_str.substring(0, colon1).trim();
+ int hours = StringParser::string_to_int_internal<int32_t, true>(hours_sub.data,
+ hours_sub.size, &success);
+ if (success != StringParser::PARSE_SUCCESS) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid hours format in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ StringRef minutes_sub = time_hour_str.substring(colon1 + 1, colon2 - colon1 - 1).trim();
+ int minutes = StringParser::string_to_int_internal<int32_t, true>(
+ minutes_sub.data, minutes_sub.size, &success);
+ if (success != StringParser::PARSE_SUCCESS) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid minutes format in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ StringRef seconds_sub = time_hour_str.substring(colon2 + 1).trim();
+ int seconds = StringParser::string_to_int_internal<int32_t, true>(
+ seconds_sub.data, seconds_sub.size, &success);
+ if (success != StringParser::PARSE_SUCCESS) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid seconds format in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+
+ return days * 24 * 3600 + hours * 3600 + minutes * 60 + seconds;
Review Comment:
seems that you extract each part separately here, I wonder if this will cause some issues when dealing with negative numbers. In MySQL, day_second is treated as a whole, with its positive or negative value determined by the DAY value, for example:
```text
mysql> select date_add("2025-10-29", INTERVAL "-1 1:1:1" DAY_SECOND);
+--------------------------------------------------------+
| date_add("2025-10-29", INTERVAL "-1 1:1:1" DAY_SECOND) |
+--------------------------------------------------------+
| 2025-10-27 22:58:59 |
+--------------------------------------------------------+
1 row in set (0.00 sec)
mysql> select date_add("2025-10-29", INTERVAL "-1 1:-1:1" DAY_SECOND);
+---------------------------------------------------------+
| date_add("2025-10-29", INTERVAL "-1 1:-1:1" DAY_SECOND) |
+---------------------------------------------------------+
| 2025-10-27 22:58:59 |
+---------------------------------------------------------+
1 row in set (0.00 sec)
mysql> select date_add("2025-10-29", INTERVAL "1 -1:1:1" DAY_SECOND);
+--------------------------------------------------------+
| date_add("2025-10-29", INTERVAL "1 -1:1:1" DAY_SECOND) |
+--------------------------------------------------------+
| 2025-10-30 01:01:01 |
+--------------------------------------------------------+
1 row in set (0.00 sec)
```
Please confirm this point, and better add some regression tests and supplement the corresponding results in `.out` file.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "Thearas (via GitHub)" <gi...@apache.org>.
Thearas commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3434886943
Thank you for your contribution to Apache Doris.
Don't know what should be done next? See [How to process your PR](https://cwiki.apache.org/confluence/display/DORIS/How+to+process+your+PR).
Please clearly describe your PR:
1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
3. What features were added. Why was this function added?
4. Which code was refactored and why was this part of the code refactored?
5. Which functions were optimized and what is the difference before and after the optimization?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3434974350
# FE UT Coverage Report
Increment line coverage ` 2.70% (1/37)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/57253_b637a6f129e9590b4f0c122144dfaad95e1eb16a/fe_increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/57253_b637a6f129e9590b4f0c122144dfaad95e1eb16a/fe_report/index.html)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3435300180
# FE Regression Coverage Report
Increment line coverage ` 27.03% (10/37)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/57253_b637a6f129e9590b4f0c122144dfaad95e1eb16a_merge_fe/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/57253_b637a6f129e9590b4f0c122144dfaad95e1eb16a_merge_fe/report/index.html)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "zclllyybb (via GitHub)" <gi...@apache.org>.
zclllyybb commented on code in PR #57253:
URL: https://github.com/apache/doris/pull/57253#discussion_r2454073413
##########
regression-test/suites/query_p0/sql_functions/datetime_functions/test_date_function.groovy:
##########
Review Comment:
need many other test include testFoldConst, scalar to scalar, ...
##########
be/src/vec/functions/function_date_or_datetime_computation.h:
##########
@@ -580,10 +617,72 @@ class FunctionDateOrDateTimeComputation : public IFunction {
// vector-const
if (const auto* nest_col1_const = check_and_get_column<ColumnConst>(*nest_col1)) {
rconst = true;
- const auto col1_inside_const =
- assert_cast<const IntervalColumnType&>(nest_col1_const->get_data_column());
- Op::vector_constant(sources->get_data(), res_col->get_data(),
- col1_inside_const.get_data()[0], nullmap0, nullmap1);
+ if constexpr (Transform::IntervalPRealType == TYPE_STRING) {
+ StringRef time_str = nest_col1_const->get_data_at(0).trim();
Review Comment:
why think col1 is const? for arguments all const, here will get non-const.
##########
be/src/vec/functions/function_date_or_datetime_computation.h:
##########
@@ -124,11 +127,34 @@ ADD_TIME_FUNCTION_IMPL(AddWeeksImpl, weeks_add, WEEK);
ADD_TIME_FUNCTION_IMPL(AddMonthsImpl, months_add, MONTH);
ADD_TIME_FUNCTION_IMPL(AddYearsImpl, years_add, YEAR);
+template <PrimitiveType PType>
+struct AddDaySecondImpl {
+ static constexpr PrimitiveType ArgPType = PType;
+ static constexpr PrimitiveType ReturnType = PType;
+ static constexpr PrimitiveType IntervalPType = PrimitiveType ::TYPE_INT;
+ static constexpr PrimitiveType IntervalPRealType = TYPE_STRING;
Review Comment:
why add this? why cant just use `IntervalPType`?
##########
be/src/vec/functions/function_date_or_datetime_computation.h:
##########
@@ -580,10 +617,72 @@ class FunctionDateOrDateTimeComputation : public IFunction {
// vector-const
if (const auto* nest_col1_const = check_and_get_column<ColumnConst>(*nest_col1)) {
rconst = true;
- const auto col1_inside_const =
- assert_cast<const IntervalColumnType&>(nest_col1_const->get_data_column());
- Op::vector_constant(sources->get_data(), res_col->get_data(),
- col1_inside_const.get_data()[0], nullmap0, nullmap1);
+ if constexpr (Transform::IntervalPRealType == TYPE_STRING) {
Review Comment:
type is `TYPE_STRING` could represent `day_second` just now. shouldn't put the logic here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "uchenily (via GitHub)" <gi...@apache.org>.
uchenily commented on code in PR #57253:
URL: https://github.com/apache/doris/pull/57253#discussion_r2454349868
##########
regression-test/suites/query_p0/sql_functions/datetime_functions/test_date_function.groovy:
##########
Review Comment:
done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3436508264
# BE Regression && UT Coverage Report
Increment line coverage `74.24% (49/66)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/57253_105c9a09cb0cc2fe2259bea9917d9c6dce438c35_merge/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/57253_105c9a09cb0cc2fe2259bea9917d9c6dce438c35_merge/report/index.html)
| Category | Coverage |
|-------------------|--------------------|
| Function Coverage | 71.42% (23906/33473) |
| Line Coverage | 57.82% (248819/430350) |
| Region Coverage | 52.85% (206054/389862) |
| Branch Coverage | 54.66% (88789/162452) |
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3435246696
# BE Regression && UT Coverage Report
Increment line coverage `74.24% (49/66)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/57253_b637a6f129e9590b4f0c122144dfaad95e1eb16a_merge/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/57253_b637a6f129e9590b4f0c122144dfaad95e1eb16a_merge/report/index.html)
| Category | Coverage |
|-------------------|--------------------|
| Function Coverage | 71.44% (23895/33449) |
| Line Coverage | 57.85% (248680/429865) |
| Region Coverage | 52.93% (206204/389615) |
| Branch Coverage | 54.72% (88841/162347) |
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "uchenily (via GitHub)" <gi...@apache.org>.
uchenily commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3435865327
run buildall
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3440523985
# FE UT Coverage Report
Increment line coverage ` 51.35% (19/37)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/57253_f7b7cce38d3d585232b5c84417754a00a2e78da2/fe_increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/57253_f7b7cce38d3d585232b5c84417754a00a2e78da2/fe_report/index.html)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3436008079
<details>
<summary>ClickBench: <b>Total hot run time: 28.38 s</b></summary>
```
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 105c9a09cb0cc2fe2259bea9917d9c6dce438c35, data reload: false
query1 0.06 0.06 0.06
query2 0.10 0.06 0.05
query3 0.26 0.09 0.08
query4 1.63 0.12 0.12
query5 0.29 0.28 0.25
query6 1.21 0.68 0.66
query7 0.05 0.03 0.03
query8 0.07 0.06 0.05
query9 0.62 0.55 0.54
query10 0.60 0.62 0.58
query11 0.17 0.12 0.13
query12 0.17 0.12 0.13
query13 0.63 0.62 0.62
query14 1.02 1.02 1.02
query15 0.86 0.85 0.88
query16 0.39 0.41 0.43
query17 1.06 1.08 1.05
query18 0.23 0.22 0.22
query19 1.94 1.85 1.90
query20 0.03 0.02 0.02
query21 15.43 0.19 0.14
query22 4.99 0.08 0.06
query23 15.64 0.28 0.11
query24 2.46 0.68 0.75
query25 0.08 0.07 0.07
query26 0.16 0.15 0.14
query27 0.08 0.06 0.06
query28 4.65 1.17 0.96
query29 12.55 4.08 3.36
query30 0.32 0.17 0.13
query31 2.82 0.61 0.39
query32 3.26 0.56 0.47
query33 3.08 3.11 3.04
query34 15.90 5.15 4.57
query35 4.63 4.60 4.58
query36 0.71 0.52 0.50
query37 0.12 0.07 0.08
query38 0.07 0.05 0.05
query39 0.04 0.03 0.04
query40 0.18 0.15 0.16
query41 0.09 0.04 0.04
query42 0.04 0.04 0.04
query43 0.04 0.04 0.04
Total cold run time: 98.73 s
Total hot run time: 28.38 s
```
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "codeDing18 (via GitHub)" <gi...@apache.org>.
codeDing18 commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3461689412
run p0
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3459871004
# BE UT Coverage Report
Increment line coverage `44.55% (49/110)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/845a0bc418dc5862dd1a4714a7e31bc8b989c02c_845a0bc418dc5862dd1a4714a7e31bc8b989c02c/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/845a0bc418dc5862dd1a4714a7e31bc8b989c02c_845a0bc418dc5862dd1a4714a7e31bc8b989c02c/report/index.html)
| Category | Coverage |
|-------------------|--------------------|
| Function Coverage | 52.76% (18062/34234) |
| Line Coverage | 38.00% (163798/431092) |
| Region Coverage | 32.38% (124870/385672) |
| Branch Coverage | 33.74% (54585/161787) |
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "linrrzqqq (via GitHub)" <gi...@apache.org>.
linrrzqqq commented on code in PR #57253:
URL: https://github.com/apache/doris/pull/57253#discussion_r2471901060
##########
be/src/vec/functions/function_date_or_datetime_computation.h:
##########
@@ -125,6 +126,88 @@ ADD_TIME_FUNCTION_IMPL(AddWeeksImpl, weeks_add, WEEK);
ADD_TIME_FUNCTION_IMPL(AddMonthsImpl, months_add, MONTH);
ADD_TIME_FUNCTION_IMPL(AddYearsImpl, years_add, YEAR);
+template <PrimitiveType PType>
+struct AddDaySecondImpl {
+ static constexpr PrimitiveType ArgPType = PType;
+ static constexpr PrimitiveType ReturnType = PType;
+ static constexpr PrimitiveType IntervalPType = PrimitiveType ::TYPE_STRING;
+ using InputNativeType = typename PrimitiveTypeTraits<PType>::DataType ::FieldType;
+ using ReturnNativeType = InputNativeType;
+ using IntervalDataType = typename PrimitiveTypeTraits<IntervalPType>::DataType;
+ using IntervalNativeType = IntervalDataType::FieldType; // string
+ using ConvertedType = typename PrimitiveTypeTraits<TYPE_BIGINT>::DataType::FieldType;
+
+ static constexpr auto name = "day_second_add";
+ static constexpr auto is_nullable = false;
+
+ static inline ReturnNativeType execute(const InputNativeType& t, IntervalNativeType delta) {
+ long seconds = parse_time_string_to_seconds(delta);
+ return date_time_add<TimeUnit::SECOND, PType, ConvertedType>(t, seconds);
+ }
+
+ static DataTypes get_variadic_argument_types() {
+ return {std ::make_shared<typename PrimitiveTypeTraits<PType>::DataType>(),
+ std ::make_shared<typename PrimitiveTypeTraits<IntervalPType>::DataType>()};
+ }
+
+ static long parse_time_string_to_seconds(IntervalNativeType time_str_ref) {
+ auto time_str = StringRef {time_str_ref.data(), time_str_ref.length()}.trim();
+ // string format: "d h:m:s"
+ size_t space_pos = time_str.find_first_of(' ');
+ if (space_pos == std::string::npos) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT,
+ "Invalid time format, missing space in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ // day
+ StringRef days_sub = time_str.substring(0, space_pos).trim();
+ StringParser::ParseResult success;
+ int days = StringParser::string_to_int_internal<int32_t, true>(days_sub.data, days_sub.size,
+ &success);
+ if (success != StringParser::PARSE_SUCCESS) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid days format in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ // hour:minute:second
+ StringRef time_hour_str = time_str.substring(space_pos + 1);
+ size_t colon1 = time_hour_str.find_first_of(':');
+ if (colon1 == std::string::npos) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid time format, missing ':' in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ size_t colon2_rel = time_hour_str.substring(colon1 + 1).find_first_of(':');
+ size_t colon2 =
+ (colon2_rel != std::string::npos) ? colon1 + 1 + colon2_rel : std::string::npos;
+ if (colon2 == std::string::npos) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid time format, missing ':' in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ StringRef hours_sub = time_hour_str.substring(0, colon1).trim();
+ int hours = StringParser::string_to_int_internal<int32_t, true>(hours_sub.data,
+ hours_sub.size, &success);
+ if (success != StringParser::PARSE_SUCCESS) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid hours format in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ StringRef minutes_sub = time_hour_str.substring(colon1 + 1, colon2 - colon1 - 1).trim();
+ int minutes = StringParser::string_to_int_internal<int32_t, true>(
+ minutes_sub.data, minutes_sub.size, &success);
+ if (success != StringParser::PARSE_SUCCESS) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid minutes format in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ StringRef seconds_sub = time_hour_str.substring(colon2 + 1).trim();
+ int seconds = StringParser::string_to_int_internal<int32_t, true>(
+ seconds_sub.data, seconds_sub.size, &success);
+ if (success != StringParser::PARSE_SUCCESS) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid seconds format in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+
+ return days * 24 * 3600 + hours * 3600 + minutes * 60 + seconds;
Review Comment:
just solve in this pr
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3450313367
<details>
<summary>ClickBench: <b>Total hot run time: 27.95 s</b></summary>
```
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 0683b0b9f1c53f3920b21d71ed4545bd725f6b09, data reload: false
query1 0.06 0.05 0.05
query2 0.10 0.05 0.06
query3 0.26 0.09 0.08
query4 1.60 0.12 0.12
query5 0.29 0.26 0.25
query6 1.19 0.66 0.64
query7 0.03 0.02 0.02
query8 0.06 0.04 0.04
query9 0.62 0.53 0.52
query10 0.58 0.57 0.58
query11 0.16 0.11 0.12
query12 0.16 0.12 0.12
query13 0.61 0.60 0.60
query14 1.00 1.02 1.00
query15 0.86 0.85 0.87
query16 0.39 0.39 0.39
query17 1.03 1.02 1.06
query18 0.23 0.20 0.20
query19 1.96 1.84 1.77
query20 0.02 0.01 0.02
query21 15.47 0.17 0.13
query22 5.11 0.07 0.04
query23 15.63 0.28 0.10
query24 2.64 1.20 0.81
query25 0.08 0.06 0.06
query26 0.14 0.13 0.14
query27 0.07 0.06 0.06
query28 5.14 1.13 0.93
query29 12.64 3.99 3.29
query30 0.28 0.13 0.11
query31 2.82 0.57 0.38
query32 3.24 0.55 0.47
query33 3.03 3.04 3.06
query34 15.76 5.19 4.57
query35 4.63 4.57 4.56
query36 0.67 0.52 0.49
query37 0.11 0.07 0.07
query38 0.08 0.04 0.04
query39 0.03 0.03 0.03
query40 0.18 0.14 0.15
query41 0.08 0.03 0.04
query42 0.04 0.04 0.03
query43 0.05 0.03 0.03
Total cold run time: 99.13 s
Total hot run time: 27.95 s
```
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3454135322
<details>
<summary>ClickBench: <b>Total hot run time: 27.44 s</b></summary>
```
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 845a0bc418dc5862dd1a4714a7e31bc8b989c02c, data reload: false
query1 0.06 0.06 0.05
query2 0.10 0.06 0.06
query3 0.26 0.08 0.08
query4 1.60 0.12 0.12
query5 0.26 0.27 0.25
query6 1.23 0.66 0.65
query7 0.04 0.02 0.02
query8 0.06 0.04 0.04
query9 0.63 0.53 0.51
query10 0.58 0.57 0.56
query11 0.17 0.11 0.11
query12 0.16 0.12 0.12
query13 0.63 0.60 0.61
query14 1.04 1.01 1.00
query15 0.85 0.83 0.84
query16 0.42 0.39 0.39
query17 0.98 1.02 1.04
query18 0.22 0.20 0.20
query19 1.88 1.81 1.82
query20 0.01 0.01 0.01
query21 15.44 0.20 0.13
query22 5.06 0.07 0.05
query23 15.69 0.25 0.09
query24 2.69 0.44 0.27
query25 0.07 0.06 0.06
query26 0.14 0.14 0.14
query27 0.06 0.06 0.06
query28 3.51 1.15 0.95
query29 12.56 4.02 3.30
query30 0.30 0.14 0.12
query31 2.82 0.57 0.38
query32 3.24 0.56 0.47
query33 3.06 3.06 3.02
query34 15.72 5.21 4.53
query35 4.60 4.55 4.62
query36 0.67 0.51 0.51
query37 0.10 0.06 0.07
query38 0.07 0.05 0.04
query39 0.03 0.03 0.03
query40 0.17 0.15 0.15
query41 0.08 0.03 0.03
query42 0.04 0.03 0.03
query43 0.05 0.04 0.04
Total cold run time: 97.35 s
Total hot run time: 27.44 s
```
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "uchenily (via GitHub)" <gi...@apache.org>.
uchenily commented on code in PR #57253:
URL: https://github.com/apache/doris/pull/57253#discussion_r2471830361
##########
be/src/vec/functions/function_date_or_datetime_computation.h:
##########
@@ -125,6 +126,88 @@ ADD_TIME_FUNCTION_IMPL(AddWeeksImpl, weeks_add, WEEK);
ADD_TIME_FUNCTION_IMPL(AddMonthsImpl, months_add, MONTH);
ADD_TIME_FUNCTION_IMPL(AddYearsImpl, years_add, YEAR);
+template <PrimitiveType PType>
+struct AddDaySecondImpl {
+ static constexpr PrimitiveType ArgPType = PType;
+ static constexpr PrimitiveType ReturnType = PType;
+ static constexpr PrimitiveType IntervalPType = PrimitiveType ::TYPE_STRING;
+ using InputNativeType = typename PrimitiveTypeTraits<PType>::DataType ::FieldType;
+ using ReturnNativeType = InputNativeType;
+ using IntervalDataType = typename PrimitiveTypeTraits<IntervalPType>::DataType;
+ using IntervalNativeType = IntervalDataType::FieldType; // string
+ using ConvertedType = typename PrimitiveTypeTraits<TYPE_BIGINT>::DataType::FieldType;
+
+ static constexpr auto name = "day_second_add";
+ static constexpr auto is_nullable = false;
+
+ static inline ReturnNativeType execute(const InputNativeType& t, IntervalNativeType delta) {
+ long seconds = parse_time_string_to_seconds(delta);
+ return date_time_add<TimeUnit::SECOND, PType, ConvertedType>(t, seconds);
+ }
+
+ static DataTypes get_variadic_argument_types() {
+ return {std ::make_shared<typename PrimitiveTypeTraits<PType>::DataType>(),
+ std ::make_shared<typename PrimitiveTypeTraits<IntervalPType>::DataType>()};
+ }
+
+ static long parse_time_string_to_seconds(IntervalNativeType time_str_ref) {
+ auto time_str = StringRef {time_str_ref.data(), time_str_ref.length()}.trim();
+ // string format: "d h:m:s"
+ size_t space_pos = time_str.find_first_of(' ');
+ if (space_pos == std::string::npos) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT,
+ "Invalid time format, missing space in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ // day
+ StringRef days_sub = time_str.substring(0, space_pos).trim();
+ StringParser::ParseResult success;
+ int days = StringParser::string_to_int_internal<int32_t, true>(days_sub.data, days_sub.size,
+ &success);
+ if (success != StringParser::PARSE_SUCCESS) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid days format in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ // hour:minute:second
+ StringRef time_hour_str = time_str.substring(space_pos + 1);
+ size_t colon1 = time_hour_str.find_first_of(':');
+ if (colon1 == std::string::npos) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid time format, missing ':' in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ size_t colon2_rel = time_hour_str.substring(colon1 + 1).find_first_of(':');
+ size_t colon2 =
+ (colon2_rel != std::string::npos) ? colon1 + 1 + colon2_rel : std::string::npos;
+ if (colon2 == std::string::npos) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid time format, missing ':' in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ StringRef hours_sub = time_hour_str.substring(0, colon1).trim();
+ int hours = StringParser::string_to_int_internal<int32_t, true>(hours_sub.data,
+ hours_sub.size, &success);
+ if (success != StringParser::PARSE_SUCCESS) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid hours format in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ StringRef minutes_sub = time_hour_str.substring(colon1 + 1, colon2 - colon1 - 1).trim();
+ int minutes = StringParser::string_to_int_internal<int32_t, true>(
+ minutes_sub.data, minutes_sub.size, &success);
+ if (success != StringParser::PARSE_SUCCESS) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid minutes format in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ StringRef seconds_sub = time_hour_str.substring(colon2 + 1).trim();
+ int seconds = StringParser::string_to_int_internal<int32_t, true>(
+ seconds_sub.data, seconds_sub.size, &success);
+ if (success != StringParser::PARSE_SUCCESS) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid seconds format in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+
+ return days * 24 * 3600 + hours * 3600 + minutes * 60 + seconds;
Review Comment:
Good catch! yes, compared to mysql, there are differences when dealing with negative numbers. Maybe we can improve the compatibility of MySQL's DAY_SECOND semantics in the next PR?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3459493607
PR approved by anyone and no changes requested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3455028635
# FE Regression Coverage Report
Increment line coverage ` 83.78% (31/37)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/57253_845a0bc418dc5862dd1a4714a7e31bc8b989c02c_merge_fe/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/57253_845a0bc418dc5862dd1a4714a7e31bc8b989c02c_merge_fe/report/index.html)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "uchenily (via GitHub)" <gi...@apache.org>.
uchenily commented on code in PR #57253:
URL: https://github.com/apache/doris/pull/57253#discussion_r2471946467
##########
be/src/vec/functions/function_date_or_datetime_computation.h:
##########
@@ -125,6 +126,88 @@ ADD_TIME_FUNCTION_IMPL(AddWeeksImpl, weeks_add, WEEK);
ADD_TIME_FUNCTION_IMPL(AddMonthsImpl, months_add, MONTH);
ADD_TIME_FUNCTION_IMPL(AddYearsImpl, years_add, YEAR);
+template <PrimitiveType PType>
+struct AddDaySecondImpl {
+ static constexpr PrimitiveType ArgPType = PType;
+ static constexpr PrimitiveType ReturnType = PType;
+ static constexpr PrimitiveType IntervalPType = PrimitiveType ::TYPE_STRING;
+ using InputNativeType = typename PrimitiveTypeTraits<PType>::DataType ::FieldType;
+ using ReturnNativeType = InputNativeType;
+ using IntervalDataType = typename PrimitiveTypeTraits<IntervalPType>::DataType;
+ using IntervalNativeType = IntervalDataType::FieldType; // string
+ using ConvertedType = typename PrimitiveTypeTraits<TYPE_BIGINT>::DataType::FieldType;
+
+ static constexpr auto name = "day_second_add";
+ static constexpr auto is_nullable = false;
+
+ static inline ReturnNativeType execute(const InputNativeType& t, IntervalNativeType delta) {
+ long seconds = parse_time_string_to_seconds(delta);
+ return date_time_add<TimeUnit::SECOND, PType, ConvertedType>(t, seconds);
+ }
+
+ static DataTypes get_variadic_argument_types() {
+ return {std ::make_shared<typename PrimitiveTypeTraits<PType>::DataType>(),
+ std ::make_shared<typename PrimitiveTypeTraits<IntervalPType>::DataType>()};
+ }
+
+ static long parse_time_string_to_seconds(IntervalNativeType time_str_ref) {
+ auto time_str = StringRef {time_str_ref.data(), time_str_ref.length()}.trim();
+ // string format: "d h:m:s"
+ size_t space_pos = time_str.find_first_of(' ');
+ if (space_pos == std::string::npos) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT,
+ "Invalid time format, missing space in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ // day
+ StringRef days_sub = time_str.substring(0, space_pos).trim();
+ StringParser::ParseResult success;
+ int days = StringParser::string_to_int_internal<int32_t, true>(days_sub.data, days_sub.size,
+ &success);
+ if (success != StringParser::PARSE_SUCCESS) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid days format in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ // hour:minute:second
+ StringRef time_hour_str = time_str.substring(space_pos + 1);
+ size_t colon1 = time_hour_str.find_first_of(':');
+ if (colon1 == std::string::npos) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid time format, missing ':' in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ size_t colon2_rel = time_hour_str.substring(colon1 + 1).find_first_of(':');
+ size_t colon2 =
+ (colon2_rel != std::string::npos) ? colon1 + 1 + colon2_rel : std::string::npos;
+ if (colon2 == std::string::npos) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid time format, missing ':' in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ StringRef hours_sub = time_hour_str.substring(0, colon1).trim();
+ int hours = StringParser::string_to_int_internal<int32_t, true>(hours_sub.data,
+ hours_sub.size, &success);
+ if (success != StringParser::PARSE_SUCCESS) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid hours format in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ StringRef minutes_sub = time_hour_str.substring(colon1 + 1, colon2 - colon1 - 1).trim();
+ int minutes = StringParser::string_to_int_internal<int32_t, true>(
+ minutes_sub.data, minutes_sub.size, &success);
+ if (success != StringParser::PARSE_SUCCESS) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid minutes format in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+ StringRef seconds_sub = time_hour_str.substring(colon2 + 1).trim();
+ int seconds = StringParser::string_to_int_internal<int32_t, true>(
+ seconds_sub.data, seconds_sub.size, &success);
+ if (success != StringParser::PARSE_SUCCESS) {
+ throw Exception(ErrorCode::INVALID_ARGUMENT, "Invalid seconds format in '{}'",
+ std::string_view {time_str.data, time_str.size});
+ }
+
+ return days * 24 * 3600 + hours * 3600 + minutes * 60 + seconds;
Review Comment:
ok, please help to review again @linrrzqqq @zclllyybb
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3461286083
# FE Regression Coverage Report
Increment line coverage ` 86.67% (39/45)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/57253_7f29751805f2c76fee84ae25f1c1790d83259a4b_merge_fe/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/57253_7f29751805f2c76fee84ae25f1c1790d83259a4b_merge_fe/report/index.html)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3435638555
# BE Regression && UT Coverage Report
Increment line coverage `74.24% (49/66)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/57253_b637a6f129e9590b4f0c122144dfaad95e1eb16a_merge/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/57253_b637a6f129e9590b4f0c122144dfaad95e1eb16a_merge/report/index.html)
| Category | Coverage |
|-------------------|--------------------|
| Function Coverage | 71.44% (23895/33449) |
| Line Coverage | 57.85% (248677/429865) |
| Region Coverage | 52.89% (206053/389615) |
| Branch Coverage | 54.72% (88840/162347) |
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3435700551
# FE Regression Coverage Report
Increment line coverage ` 27.03% (10/37)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/57253_b637a6f129e9590b4f0c122144dfaad95e1eb16a_merge_fe/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/57253_b637a6f129e9590b4f0c122144dfaad95e1eb16a_merge_fe/report/index.html)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3440391290
<details>
<summary>TPC-DS: <b>Total hot run time: 190014 ms</b></summary>
```
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit f7b7cce38d3d585232b5c84417754a00a2e78da2, data reload: false
query1 1060 436 411 411
query2 6570 1758 1696 1696
query3 6755 232 219 219
query4 26584 23511 23544 23511
query5 5122 670 505 505
query6 350 257 265 257
query7 4682 511 301 301
query8 344 271 264 264
query9 8749 2634 2629 2629
query10 552 352 296 296
query11 15507 15297 14838 14838
query12 210 120 119 119
query13 1693 558 446 446
query14 12668 9329 9220 9220
query15 218 188 175 175
query16 7688 675 490 490
query17 1575 752 630 630
query18 2132 449 346 346
query19 261 239 197 197
query20 159 133 134 133
query21 221 138 118 118
query22 4615 4644 4471 4471
query23 34716 33761 33452 33452
query24 8111 2590 2567 2567
query25 618 533 501 501
query26 1342 296 164 164
query27 2738 517 422 422
query28 5500 2242 2273 2242
query29 855 646 509 509
query30 318 230 212 212
query31 1003 1010 748 748
query32 84 73 67 67
query33 594 376 335 335
query34 841 883 539 539
query35 839 877 798 798
query36 1041 1040 948 948
query37 138 112 90 90
query38 3783 3644 3474 3474
query39 1524 1436 1406 1406
query40 213 130 115 115
query41 60 59 58 58
query42 126 111 124 111
query43 487 512 487 487
query44 1256 749 741 741
query45 181 177 173 173
query46 883 1013 650 650
query47 1723 1785 1688 1688
query48 405 425 313 313
query49 750 490 412 412
query50 654 702 417 417
query51 3894 3924 3952 3924
query52 109 106 101 101
query53 242 275 212 212
query54 605 593 554 554
query55 91 86 86 86
query56 356 366 323 323
query57 1158 1191 1132 1132
query58 310 291 282 282
query59 2618 2561 2631 2561
query60 360 376 355 355
query61 184 186 179 179
query62 806 717 717 717
query63 240 198 192 192
query64 4466 1180 840 840
query65 4096 3959 3951 3951
query66 1097 432 337 337
query67 15237 15193 14858 14858
query68 9311 906 600 600
query69 508 334 291 291
query70 1348 1311 1291 1291
query71 505 333 324 324
query72 6068 4905 4680 4680
query73 704 569 358 358
query74 9211 9022 9034 9022
query75 4343 3395 2890 2890
query76 3798 1149 730 730
query77 823 415 317 317
query78 9697 9728 8812 8812
query79 2648 834 589 589
query80 696 601 636 601
query81 536 259 233 233
query82 525 162 129 129
query83 314 273 243 243
query84 300 120 93 93
query85 914 480 441 441
query86 391 314 291 291
query87 3782 3792 3694 3694
query88 3720 2228 2218 2218
query89 385 322 299 299
query90 1976 220 218 218
query91 170 160 141 141
query92 87 70 69 69
query93 1916 973 645 645
query94 688 424 332 332
query95 407 324 324 324
query96 499 572 276 276
query97 2943 2979 2870 2870
query98 243 215 225 215
query99 1469 1436 1263 1263
Total cold run time: 285292 ms
Total hot run time: 190014 ms
```
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3440411359
<details>
<summary>ClickBench: <b>Total hot run time: 27.87 s</b></summary>
```
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit f7b7cce38d3d585232b5c84417754a00a2e78da2, data reload: false
query1 0.05 0.05 0.05
query2 0.10 0.06 0.06
query3 0.26 0.09 0.09
query4 1.62 0.12 0.12
query5 0.28 0.26 0.25
query6 1.19 0.66 0.66
query7 0.03 0.03 0.03
query8 0.05 0.04 0.04
query9 0.63 0.52 0.52
query10 0.57 0.58 0.58
query11 0.17 0.11 0.11
query12 0.16 0.12 0.13
query13 0.64 0.61 0.60
query14 1.00 1.01 1.02
query15 0.86 0.83 0.83
query16 0.39 0.39 0.38
query17 1.03 1.02 1.02
query18 0.22 0.20 0.20
query19 1.90 1.81 1.82
query20 0.02 0.02 0.01
query21 15.44 0.18 0.13
query22 5.04 0.07 0.05
query23 15.70 0.27 0.10
query24 2.61 0.60 0.82
query25 0.06 0.07 0.07
query26 0.14 0.14 0.13
query27 0.08 0.06 0.05
query28 4.30 1.15 0.95
query29 12.58 4.05 3.33
query30 0.29 0.15 0.11
query31 2.82 0.60 0.38
query32 3.23 0.55 0.48
query33 3.13 3.05 3.13
query34 15.92 5.22 4.56
query35 4.59 4.53 4.58
query36 0.69 0.51 0.50
query37 0.10 0.07 0.07
query38 0.07 0.05 0.04
query39 0.04 0.03 0.03
query40 0.17 0.17 0.14
query41 0.09 0.03 0.03
query42 0.04 0.03 0.03
query43 0.04 0.03 0.02
Total cold run time: 98.34 s
Total hot run time: 27.87 s
```
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3450404672
# BE UT Coverage Report
Increment line coverage `44.55% (49/110)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/0683b0b9f1c53f3920b21d71ed4545bd725f6b09_0683b0b9f1c53f3920b21d71ed4545bd725f6b09/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/0683b0b9f1c53f3920b21d71ed4545bd725f6b09_0683b0b9f1c53f3920b21d71ed4545bd725f6b09/report/index.html)
| Category | Coverage |
|-------------------|--------------------|
| Function Coverage | 52.65% (17969/34132) |
| Line Coverage | 37.92% (163069/430059) |
| Region Coverage | 32.32% (124344/384709) |
| Branch Coverage | 33.69% (54364/161362) |
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3441573876
# BE Regression && UT Coverage Report
Increment line coverage `74.24% (49/66)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/57253_f7b7cce38d3d585232b5c84417754a00a2e78da2_merge/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/57253_f7b7cce38d3d585232b5c84417754a00a2e78da2_merge/report/index.html)
| Category | Coverage |
|-------------------|--------------------|
| Function Coverage | 71.32% (23873/33474) |
| Line Coverage | 57.73% (248457/430364) |
| Region Coverage | 52.76% (205707/389864) |
| Branch Coverage | 54.54% (88603/162452) |
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3449637524
<details>
<summary>TPC-DS: <b>Total hot run time: 190177 ms</b></summary>
```
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 4ea2174d91e5172e2760056b2f0ab1b1cf2505ce, data reload: false
query1 1061 411 402 402
query2 6579 1706 1668 1668
query3 6760 234 226 226
query4 26777 23899 23402 23402
query5 5070 619 488 488
query6 344 256 249 249
query7 4654 502 303 303
query8 325 281 287 281
query9 8762 2581 2605 2581
query10 530 360 300 300
query11 15416 15111 14768 14768
query12 193 126 117 117
query13 1782 575 460 460
query14 11785 9313 9333 9313
query15 252 195 180 180
query16 7818 674 532 532
query17 1629 836 614 614
query18 2068 471 352 352
query19 326 209 199 199
query20 134 135 130 130
query21 225 136 130 130
query22 4590 4452 4533 4452
query23 34779 33662 33668 33662
query24 8637 2556 2661 2556
query25 584 530 492 492
query26 1247 293 165 165
query27 2935 646 402 402
query28 5368 2248 2245 2245
query29 1278 634 505 505
query30 310 232 200 200
query31 980 829 755 755
query32 87 82 90 82
query33 603 421 358 358
query34 837 891 591 591
query35 826 866 804 804
query36 1005 1059 914 914
query37 118 117 98 98
query38 3568 3560 3502 3502
query39 1474 1424 1431 1424
query40 223 130 117 117
query41 71 64 61 61
query42 124 118 108 108
query43 508 493 470 470
query44 1258 754 742 742
query45 183 173 174 173
query46 892 986 643 643
query47 1756 1779 1687 1687
query48 404 421 335 335
query49 795 538 449 449
query50 663 693 416 416
query51 3940 3884 3877 3877
query52 110 111 102 102
query53 258 270 195 195
query54 603 596 527 527
query55 90 83 88 83
query56 329 337 334 334
query57 1164 1177 1110 1110
query58 294 289 277 277
query59 2506 2633 2583 2583
query60 350 340 337 337
query61 161 160 163 160
query62 805 727 757 727
query63 242 198 203 198
query64 4441 1165 842 842
query65 4096 3930 3960 3930
query66 1093 456 364 364
query67 15421 14980 14845 14845
query68 8378 974 603 603
query69 495 348 284 284
query70 1384 1230 1271 1230
query71 501 340 329 329
query72 5944 4921 5035 4921
query73 719 598 363 363
query74 8930 9109 8798 8798
query75 4062 3389 2825 2825
query76 3786 1150 745 745
query77 813 424 318 318
query78 9597 9741 8901 8901
query79 2000 850 612 612
query80 692 592 544 544
query81 507 264 229 229
query82 432 165 136 136
query83 304 274 245 245
query84 299 129 93 93
query85 890 474 430 430
query86 353 330 291 291
query87 3816 3766 3708 3708
query88 3280 2291 2253 2253
query89 397 326 312 312
query90 2047 235 228 228
query91 164 169 134 134
query92 92 75 68 68
query93 1208 986 651 651
query94 704 457 349 349
query95 428 337 319 319
query96 506 583 286 286
query97 2955 2997 2876 2876
query98 239 214 212 212
query99 1467 1461 1290 1290
Total cold run time: 281885 ms
Total hot run time: 190177 ms
```
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3449648116
<details>
<summary>ClickBench: <b>Total hot run time: 27.59 s</b></summary>
```
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 4ea2174d91e5172e2760056b2f0ab1b1cf2505ce, data reload: false
query1 0.06 0.05 0.05
query2 0.10 0.05 0.06
query3 0.25 0.09 0.09
query4 1.61 0.12 0.12
query5 0.27 0.27 0.26
query6 1.17 0.67 0.65
query7 0.03 0.03 0.03
query8 0.06 0.05 0.05
query9 0.63 0.54 0.53
query10 0.60 0.58 0.58
query11 0.16 0.11 0.12
query12 0.17 0.13 0.12
query13 0.62 0.59 0.61
query14 1.00 1.01 1.01
query15 0.85 0.84 0.85
query16 0.39 0.40 0.40
query17 1.05 1.03 1.04
query18 0.22 0.20 0.20
query19 1.89 1.79 1.77
query20 0.01 0.02 0.01
query21 15.49 0.19 0.12
query22 5.07 0.06 0.04
query23 15.66 0.28 0.10
query24 2.63 1.04 0.44
query25 0.07 0.07 0.06
query26 0.14 0.14 0.13
query27 0.07 0.05 0.06
query28 3.74 1.17 0.93
query29 12.54 3.96 3.28
query30 0.29 0.15 0.12
query31 2.81 0.61 0.39
query32 3.24 0.55 0.47
query33 3.03 3.04 3.12
query34 15.84 5.13 4.51
query35 4.60 4.58 4.57
query36 0.69 0.51 0.50
query37 0.09 0.07 0.07
query38 0.07 0.04 0.03
query39 0.04 0.03 0.03
query40 0.17 0.14 0.13
query41 0.09 0.03 0.03
query42 0.04 0.03 0.03
query43 0.04 0.03 0.04
Total cold run time: 97.59 s
Total hot run time: 27.59 s
```
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feature](function) The date_add function supports DAY_SECOND as interval type [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #57253:
URL: https://github.com/apache/doris/pull/57253#issuecomment-3441624693
# FE Regression Coverage Report
Increment line coverage ` 83.78% (31/37)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/57253_f7b7cce38d3d585232b5c84417754a00a2e78da2_merge_fe/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/57253_f7b7cce38d3d585232b5c84417754a00a2e78da2_merge_fe/report/index.html)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org