-
Notifications
You must be signed in to change notification settings - Fork 847
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
API to take back ownership of an ArrayRef #2901
Comments
I think |
Closes apache#2901.
Or we could maybe add a |
It is complaining that
I actually wrote up how to support this on #1981 In particular https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=abb7fcf97e33ba83d44b17f6c89e8f0b I'll get this into a PR Edit: Lifetimes cause issues 😢 |
Note that @crepererum wrote #2902 |
Yeah, I was hoping to avoid leaking this into the public interface as that PR does... Perhaps it is unavoidable 😅 |
Would it be an option to remove |
Yes, unfortunately |
I found a workaround in the DataFusion codebase -- namely create it from BooleanArray::from(mask.data().clone()) |
Yeah, the downside is it isn't quite as cheap. But maybe that is fine |
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
@crepererum and I are using
BooleanArray
to work as a bitset but the api is slightly cumbersome as the compute kernels give back anArrayRef
so we have to do some clunky downcastingDescribe the solution you'd like
I would like some way to convert an
ArrayRef
toBooleanArray
I can go from
ArrayRef
to&BooleanArray
with functions like https://docs.rs/arrow/25.0.0/arrow/array/fn.as_boolean_array.html but I can't get the owned versionHere is a specific example / reproducer:
It doesn't compile
Describe alternatives you've considered
None yet
Additional context
You can see the context of what we are doing on https://github.com/influxdata/influxdb_iox/pull/5910 / https://github.com/influxdata/influxdb_iox/pull/5910#discussion_r1000479355
The text was updated successfully, but these errors were encountered: