-
Notifications
You must be signed in to change notification settings - Fork 875
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
Unsound MutableArrayData Constructor #5091
Comments
I think it is probably a bug that MutableArrayData lets you extend with a mixture of types, this is not what it is intended to do and is highly unlikely to behave correctly... I was sure it checked this Edit: it would appear this does is not only incorrect but is unsound, will prioritize fixing this |
MutableArrayData
may new with specified DataType
Thanks for your answer! I'm refactoring it can handle |
It is only handling this by accident and incorrectly. You need to coerce the types passed to make_array to a consistent type signature |
thanks again! I have fixed it. @tustvold |
|
Describe the bug
I want to use
MutableArrayData
to construct an array, but if the input array sequence is different, the output will be different.This is because
MutableArrayData::new_with_capacities
will use the first array's data type.https://github.com/apache/arrow-rs/blob/master/arrow-data/src/transform/mod.rs#L350-L356
To Reproduce
Such as
Expected behavior
maybe we need a method to specify the ArrayData DataType, so whatever sequence of arrays we put in, we can get the excepted result.
maybe we can have a method like
@tustvold @alamb how do you think?
Additional context
The text was updated successfully, but these errors were encountered: