-
Notifications
You must be signed in to change notification settings - Fork 803
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
Support for casting StringViewArray
to DecimalArray
#6720
Conversation
Signed-off-by: Tai Le Manh <[email protected]>
arrow-cast/src/cast/mod.rs
Outdated
@@ -2483,14 +2484,28 @@ where | |||
Ok(Arc::new(byte_array_builder.finish())) | |||
} | |||
|
|||
trait StringArrayType<'a>: ArrayAccessor<Item = &'a str> + Sized { |
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.
We would now have this in arrow-string and arrow-cast. Perhaps this would be best moved to arrow-array alongside ArrayAccessor ?
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.
@Omega359 Thanks so much for reviewing.
We would now have this in arrow-string and arrow-cast. Perhaps this would be best moved to arrow-array alongside ArrayAccessor ?
Makes sense to me 👍
Signed-off-by: Tai Le Manh <[email protected]>
StringViewArray
to DecimalArray
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.
@@ -570,6 +572,40 @@ pub trait ArrayAccessor: Array { | |||
unsafe fn value_unchecked(&self, index: usize) -> Self::Item; | |||
} | |||
|
|||
/// A trait for Arrow String Arrays, currently three types are supported: |
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 is nice to start making public -- we use it in DataFusion a bit as well, so starting to consolidate on a single implementation will be good
Which issue does this PR close?
Closes #6715.
Rationale for this change
What changes are included in this PR?
Utf8View
) to numeric(Int
/Float
/Decimal
).Are there any user-facing changes?
No.