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

add checker for appending i128 to decimal builder #928

Merged
merged 2 commits into from
Nov 10, 2021

Conversation

liukun4515
Copy link
Contributor

@liukun4515 liukun4515 commented Nov 9, 2021

Which issue does this PR close?

Closes #927

Rationale for this change

the code doesn't check the value of input i128 for the decimalbuilder.

resolve the issue #927

What changes are included in this PR?

Add checker for the append_value function in the DecimalBuilder .

Are there any user-facing changes?

No

@github-actions github-actions bot added the arrow Changes to the arrow crate label Nov 9, 2021
@liukun4515 liukun4515 changed the title [arrow-rs-927]add check for appending i128 to decimal builder [arrow-rs-927] add checker for appending i128 to decimal builder Nov 9, 2021
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 very much @liukun4515

If you can please avoid adding a new variant to ArrowError I think this PR is ready to merge.

@@ -41,6 +41,7 @@ pub enum ArrowError {
/// Error during import or export to/from the C Data Interface
CDataInterface(String),
DictionaryKeyOverflowError,
DecimalError(String),
Copy link
Contributor

Choose a reason for hiding this comment

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

Adding a new variant to this enum makes the change, strictly speaking, not backwards compatible.

I think we should use InvalidArgumentError rather than adding a new variant in order to be consistent with the rest of the codebase as well as ensure this change is backwards compatible (and can be included in the 6.2.0 release)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for your comments. I will address this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alamb I have updated this pull request according to your suggestion.

@liukun4515 liukun4515 changed the title [arrow-rs-927] add checker for appending i128 to decimal builder add checker for appending i128 to decimal builder Nov 10, 2021
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 @liukun4515 👍

@alamb alamb merged commit 1945f6f into apache:master Nov 10, 2021
alamb pushed a commit that referenced this pull request Nov 11, 2021
* add check for appending i128 to decimal builder

* remove the ArrowError(DecimalError)
alamb added a commit that referenced this pull request Nov 12, 2021
* add check for appending i128 to decimal builder

* remove the ArrowError(DecimalError)

Co-authored-by: Kun Liu <liukun@apache.org>
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.

Not check the i128 value for decimal api append_value
2 participants