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

Unsound ArrayData to Array Conversions #2834

Closed
tustvold opened this issue Oct 6, 2022 · 2 comments · Fixed by #2835
Closed

Unsound ArrayData to Array Conversions #2834

tustvold opened this issue Oct 6, 2022 · 2 comments · Fixed by #2835
Labels
arrow Changes to the arrow crate bug parquet Changes to the parquet crate

Comments

@tustvold
Copy link
Contributor

tustvold commented Oct 6, 2022

Describe the bug

Not all Array validate the DataType of the ArrayData they are being created from, which can potentially lead to unsound behaviour

To Reproduce

This should panic

#[test]
fn test_primitive_validation() {
    let foo = PrimitiveArray::<Int32Type>::from_iter([1, 2, 3]);
    PrimitiveArray::<Int64Type>::from(foo.into_data());
}

Expected behavior

All arrays should verify the type is as expected

Additional context

@tustvold tustvold added the bug label Oct 6, 2022
tustvold added a commit to tustvold/arrow-rs that referenced this issue Oct 6, 2022
tustvold added a commit that referenced this issue Oct 13, 2022
* Validate ArrayData type when converting to Array (#2834)

* Fix cast kernel and take kernel tests

* Clippy

* Fix parquet

* Clippy
@alamb alamb added the parquet Changes to the parquet crate label Oct 14, 2022
@alamb
Copy link
Contributor

alamb commented Oct 14, 2022

label_issue.py automatically added labels {'parquet'} from #2835

@alamb alamb added the arrow Changes to the arrow crate label Oct 14, 2022
@alamb
Copy link
Contributor

alamb commented Oct 14, 2022

label_issue.py automatically added labels {'arrow'} from #2835

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 bug parquet Changes to the parquet crate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants