-
Notifications
You must be signed in to change notification settings - Fork 825
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
Conversation
|
||
/// 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>( |
There was a problem hiding this comment.
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>( |
There was a problem hiding this comment.
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>( |
There was a problem hiding this comment.
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
.
There was a problem hiding this 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
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 submodulearrow_cast::cast::decimal
, makingarrow_cast::cast
smaller and more manageable.What changes are included in this PR?
The decimal handling functions from
arrow_cast::cast
now live inarrow_cast::cast::decimal
, which is located atarrow-rs/arrow-cast/src/cast/decimal.rs
.Are there any user-facing changes?
No.