Skip to content

Conversation

@github-actions
Copy link
Contributor

Cherry-picked from #57253

…rval type (#57253)

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 <csding18@qq.com>

Issue Number: close #52132
@github-actions github-actions bot requested a review from yiguolei as a code owner October 30, 2025 03:29
@hello-stephen
Copy link
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See 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?

@dataroaring dataroaring reopened this Oct 30, 2025
@hello-stephen
Copy link
Contributor

run buildall

@yiguolei yiguolei merged commit 0143660 into branch-4.0 Oct 31, 2025
23 of 25 checks passed
@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Oct 31, 2025
@github-actions
Copy link
Contributor Author

PR approved by at least one committer and no changes requested.

@github-actions
Copy link
Contributor Author

PR approved by anyone and no changes requested.

@github-actions github-actions bot deleted the auto-pick-57253-branch-4.0 branch October 31, 2025 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants