Skip to content

Conversation

@zclllyybb
Copy link
Contributor

pick #49429

@zclllyybb zclllyybb requested a review from yiguolei as a code owner May 6, 2025 04:21
@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
Copy link
Contributor Author

run buildall

@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
…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
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 69.57% (48/69) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 38.87% (10277/26442)
Line Coverage 29.92% (85373/285369)
Region Coverage 28.57% (44003/154038)
Branch Coverage 25.30% (22509/88978)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 92.75% (64/69) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 76.23% (19859/26052)
Line Coverage 71.66% (203202/283576)
Region Coverage 69.33% (124341/179353)
Branch Coverage 62.63% (63030/100636)

@yiguolei yiguolei merged commit 02c3157 into apache:branch-2.1 May 7, 2025
18 of 19 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.

5 participants