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

Fix string '0' cast to decimal with scale 0 #6547

Conversation

findepi
Copy link
Member

@findepi findepi commented Oct 11, 2024

Before the change, the cast used to fail or return null, depending on cast options.

Which issue does this PR close?

Rationale for this change

Correctness fix

What changes are included in this PR?

Fix to cast from string to decimal.

Are there any user-facing changes?

Yes, behavior changes

@github-actions github-actions bot added the arrow Changes to the arrow crate label Oct 11, 2024
@findepi findepi force-pushed the findepi/fix-string-0-cast-to-decimal-with-scale-0-bc5f5f branch from 2b184f4 to 6240664 Compare October 11, 2024 14:13
Before the change, the cast used to fail or return null, depending on
cast options.
@findepi
Copy link
Member Author

findepi commented Oct 11, 2024

cc @alamb

Copy link
Member

@Xuanwo Xuanwo 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 @findepi for this PR! Looks nice to me.

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.

Looks good to me -- thank you @findepi and @Xuanwo for the review

@alamb alamb merged commit 522bd01 into apache:master Oct 14, 2024
26 checks passed
@findepi findepi deleted the findepi/fix-string-0-cast-to-decimal-with-scale-0-bc5f5f branch October 14, 2024 20:50
findepi added a commit to sdf-labs/arrow-rs that referenced this pull request Oct 30, 2024
* Fix string '0' cast to decimal with scale 0

Before the change, the cast used to fail or return null, depending on
cast options.

* Add more test cases
findepi added a commit to sdf-labs/arrow-rs that referenced this pull request Oct 31, 2024
* Fix string '0' cast to decimal with scale 0

Before the change, the cast used to fail or return null, depending on
cast options.

* Add more test cases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cast from StringArray to Decimal128Array and Decimal256Array doesn't work on 0
3 participants