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

PrimitiveArray from ArrayData Unsound For IntervalArray #3439

Closed
tustvold opened this issue Jan 3, 2023 · 0 comments · Fixed by #3440
Closed

PrimitiveArray from ArrayData Unsound For IntervalArray #3439

tustvold opened this issue Jan 3, 2023 · 0 comments · Fixed by #3440
Labels
arrow Changes to the arrow crate bug

Comments

@tustvold
Copy link
Contributor

tustvold commented Jan 3, 2023

Describe the bug

Creating a PrimitiveArray from ArrayData validates that the DataType has the same discriminant as expected. For almost all types this is sufficient, with exception to DataType::Interval.

This is because DataType::Interval has a different backing primitive depending on the value of IntervalUnit

To Reproduce

#[test]
fn test_invalid_interval_type() {
    let array = IntervalDayTimeArray::from(vec![1, 2, 3]);
    let _ = IntervalMonthDayNanoArray::from(array.into_data());
}

The above should panic, but doesn't

Expected behavior

Additional context

This is a follow on to #2834

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant