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

Filtering UnionArray Changes DataType #1595

Closed
tustvold opened this issue Apr 20, 2022 · 2 comments
Closed

Filtering UnionArray Changes DataType #1595

tustvold opened this issue Apr 20, 2022 · 2 comments
Labels
question Further information is requested

Comments

@tustvold
Copy link
Contributor

Describe the bug

When filtering a UnionArray the output will only include the types that had at least one value selected by the filter. I think this is a bug, as I would not expect a filter to mutate the schema of the input

Expected behavior

This test should pass

let mut builder = UnionBuilder::new_dense(4);
builder.append::<Int32Type>("A", 1).unwrap();
builder.append::<Float64Type>("B", 3.2).unwrap();
let array = builder.build().unwrap();
let filter_array = BooleanArray::from(vec![true, false]);
let c = filter(&array, &filter_array).unwrap();

assert_eq!(array.data_type(), c.data_type())
@tustvold tustvold added question Further information is requested bug labels Apr 20, 2022
@tfeda
Copy link
Contributor

tfeda commented May 6, 2022

The code runs fine for me. Perhaps it got fixed in #1589 or #1632?

@tustvold
Copy link
Contributor Author

tustvold commented May 6, 2022

I can't reproduce this even on commits before those changes, so possibly a PEBCAC on my part here 😅

@tustvold tustvold closed this as completed May 6, 2022
@alamb alamb changed the title Filtering UnionArray Changes DataType Filtering UnionArray Changes DataType May 12, 2022
@alamb alamb removed the bug label May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants