Skip to content

Fix bug when using ROUND(0.x, 0) #17003

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

v-jizhang
Copy link
Contributor

Cherry-pick of trinodb/trino#9371

From the original PR:
"Before this commit, ROUND act like:

presto> select round(0.7, 0);
 _col0
-------
   0.0

presto> select round(0.7);
 _col0
-------
     1

presto> select round(1.7, 0);
 _col0
-------
   2.0

round(0.7, 0) got wrong result 0.0, should be 1.0. After this commit, round(0.7, 0) returns 1.0"

Co-authored-by: tinkerrrr [email protected]

== RELEASE NOTES ==

General Changes
* Fix bug when using ROUND(0.x, 0)

@stale
Copy link

stale bot commented Jun 13, 2022

This pull request has been automatically marked as stale because it has not had recent activity. If you'd still like this PR merged, please comment on the task, make sure you've addressed reviewer comments, and rebase on the latest master. Thank you for your contributions!

@stale stale bot added the stale label Jun 13, 2022
Copy link
Contributor

@ajaygeorge ajaygeorge left a comment

Choose a reason for hiding this comment

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

LGTM

@v-jizhang v-jizhang requested a review from ericyuliu August 11, 2023 21:36
@stale stale bot removed the stale label Aug 11, 2023
Cherry-pick of trinodb/trino#9371

From the original PR:
"Before this commit, ROUND act like:

presto> select round(0.7, 0);
 _col0
-------
   0.0

presto> select round(0.7);
 _col0
-------
     1

presto> select round(1.7, 0);
 _col0
-------
   2.0
round(0.7, 0) got wrong result 0.0, should be 1.0. After this commit, round(0.7, 0) returns 1.0"

Co-authored-by: tinkerrrr <[email protected]>
@v-jizhang v-jizhang requested a review from a team as a code owner August 11, 2023 21:56
@v-jizhang v-jizhang requested a review from presto-oss August 11, 2023 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants