Skip to content

Conversation

@zclllyybb
Copy link
Contributor

pick #49429

…than day (apache#49429)

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

should consider the microseconds' effect.

before:
```sql
mysql> select hours_diff('2023-10-15 00:00:00', '2023-10-14 00:00:00.1');
+------------------------------------------------------------+
| hours_diff('2023-10-15 00:00:00', '2023-10-14 00:00:00.1') |
+------------------------------------------------------------+
|                                                         24 |
+------------------------------------------------------------+
```
now:
```sql
mysql> select hours_diff('2023-10-15 00:00:00', '2023-10-14 00:00:00.1');
+------------------------------------------------------------+
| hours_diff('2023-10-15 00:00:00', '2023-10-14 00:00:00.1') |
+------------------------------------------------------------+
|                                                         23 |
+------------------------------------------------------------+
```

fix the wrong floor of function date_diff when unit less than day

- 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:
    - [x] No.
    - [ ] Yes. <!-- Explain the behavior change -->

- Does this need documentation?
    - [x] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
@zclllyybb zclllyybb requested a review from dataroaring as a code owner May 6, 2025 04:25
@zclllyybb
Copy link
Contributor Author

run buildall

@Thearas
Copy link
Contributor

Thearas commented May 6, 2025

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?

@zclllyybb zclllyybb changed the title [Fix](function) fix wrong floor of function date_diff when unit less than day (#49429) [branch-2.1](function) fix wrong floor of function date_diff when unit less than day (#49429) May 6, 2025
@zclllyybb zclllyybb changed the title [branch-2.1](function) fix wrong floor of function date_diff when unit less than day (#49429) [branch-3.0](function) fix wrong floor of function date_diff when unit less than day (#49429) May 6, 2025
@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 75.00% (48/64) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 40.95% (10788/26345)
Line Coverage 31.81% (92115/289573)
Region Coverage 30.87% (47519/153945)
Branch Coverage 27.36% (24342/88964)

Copy link
Contributor

@dataroaring dataroaring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dataroaring dataroaring merged commit f7f3674 into apache:branch-3.0 May 7, 2025
19 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants