Skip to content

Unsound ArrayData to Array Conversions #2834

@tustvold

Description

@tustvold

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    arrowChanges to the arrow cratebugparquetChanges to the parquet crate

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions