Skip to content
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

handle overflow in gcd and return this as an error #11057

Merged
merged 3 commits into from
Jun 23, 2024
Merged

handle overflow in gcd and return this as an error #11057

merged 3 commits into from
Jun 23, 2024

Conversation

LorrensP-2158466
Copy link
Contributor

Which issue does this PR close?

Closes #11053.

Rationale for this change

What changes are included in this PR?

GCD and LCM functions can now return an integer overflow error in the form of an ArrowError::Compute (abs impl does this too).

Are these changes tested?

Yes, added a unit test that tries to overflow

Are there any user-facing changes?

Users may see overflow errors instead of incorrect results

@github-actions github-actions bot added the sqllogictest SQL Logic Tests (.slt) label Jun 22, 2024
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you @LorrensP-2158466 -- this looks good to me

I took the liberty of merging this PR up from main as well as adding a .slt test

@LorrensP-2158466
Copy link
Contributor Author

Thanks!

@alamb alamb merged commit 8aad208 into apache:main Jun 23, 2024
23 checks passed
@alamb
Copy link
Contributor

alamb commented Jun 23, 2024

Thanks again @LorrensP-2158466

@LorrensP-2158466 LorrensP-2158466 deleted the handle_overflow_in_gcd branch June 23, 2024 13:50
findepi pushed a commit to findepi/datafusion that referenced this pull request Jul 16, 2024
* handle overflow in gcd and return this as an error

* Add SLT test

---------

Co-authored-by: Andrew Lamb <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle overflow in GCD scalar function
2 participants