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

Split arrow_cast::cast::decimal into it's own submodule #5552

Merged
merged 3 commits into from
Mar 26, 2024

Conversation

monkwire
Copy link
Contributor

Which issue does this PR close?

This PR addresses part of #5125.

Rationale for this change

This PR moves the decimal handling logic from arrow_cast::cast into private submodule arrow_cast::cast::decimal, making arrow_cast::cast smaller and more manageable.

What changes are included in this PR?

The decimal handling functions from arrow_cast::cast now live in arrow_cast::cast::decimal, which is located at arrow-rs/arrow-cast/src/cast/decimal.rs.

Are there any user-facing changes?

No.

@github-actions github-actions bot added the arrow Changes to the arrow crate label Mar 25, 2024

/// Parses given string to specified decimal native (i128/i256) based on given
/// scale. Returns an `Err` if it cannot parse given string.
pub(crate) fn parse_string_to_decimal_native<T: DecimalType>(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was hesitant to move this function into cast::decimal as there are plans for cast::string, and this function might be a better fit there. I ultimately chose to move this function because it returns a decimal, which seemed like a better fit for the decimal submodule.

})
}

pub(crate) fn string_to_decimal_cast<T, Offset: OffsetSizeTrait>(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Again, this might be a better fit for cast::string.

}

/// Cast Utf8 to decimal
pub(crate) fn cast_string_to_decimal<T, Offset: OffsetSizeTrait>(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This may also be a better fit for cast::string.

Copy link
Contributor

@tustvold tustvold left a comment

Choose a reason for hiding this comment

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

Miri issue is unrelated

@tustvold tustvold merged commit e1e1fb8 into apache:master Mar 26, 2024
24 of 25 checks passed
@monkwire monkwire deleted the splitarrow_castdecimal branch March 26, 2024 03:35
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.

2 participants