Skip to content

Conversation

@github-actions
Copy link
Contributor

Cherry-picked from #43422

…recision problem (#43422)

- Problem
function like ```select floor(300.343, 2)``` precision should be 5 and
scale should be 2, but now is (6, 2) after compute precision, but after
folding const on fe, it changed to (5, 2) but upper level of plan still
expect the output of child to be (6, 2). So it would rise an exception
when executing.

- How it was fixed 
fix folding constant precision of floor/round/ceil/truncate functions
from (5, 2) to (6, 2) in upper case

- Notion
when second value is negative and it absolute value >= precision -
value, it can not be expressed in fe which result is zero with decimal
type (3, 0). like 000. So just let it go back and no using folding
constant by fe.

- Related PR: #40744

- Release note
    Fix floor/round/ceil functions precision problem in folding constant
@doris-robot
Copy link

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?

@doris-robot
Copy link

run buildall

@LiBinfeng-01
Copy link
Contributor

run buildall

@LiBinfeng-01
Copy link
Contributor

run feut

@LiBinfeng-01 LiBinfeng-01 self-assigned this Nov 13, 2024
@morrySnow morrySnow merged commit 6e8a80d into branch-3.0 Nov 13, 2024
@morrySnow morrySnow deleted the auto-pick-43422-branch-3.0 branch November 13, 2024 04:00
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