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

Add TypedDictionaryArray for more ergonomic interaction with DictionaryArray #2136

Closed
tustvold opened this issue Jul 22, 2022 · 0 comments · Fixed by #2297
Closed

Add TypedDictionaryArray for more ergonomic interaction with DictionaryArray #2136

tustvold opened this issue Jul 22, 2022 · 0 comments · Fixed by #2297
Labels
arrow Changes to the arrow crate enhancement Any new improvement worthy of a entry in the changelog help wanted

Comments

@tustvold
Copy link
Contributor

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

DictionaryArray does not know the type of its underlying child array, and therefore cannot implement ArrayAccessor directly.

Describe the solution you'd like

Introduce something like the following

pub struct TypedDictionaryArray<'a, K: ArrowDictionaryKeyType, T: ArrayAccessor> {
    dict: &'a DictionaryArray<K>,
    values: T
}

impl <'a, K: ArrowDictionaryKeyType, T: ArrayAccessor> ArrayAccessor for TypedDictionaryArray<'a, K, T> {
    ...
}

This will allow having standard implementations of kernels in terms of ArrayAccessor that will also work for DictionaryArray (once downcast to the appropriate type).

Describe alternatives you've considered
We could continue to special case the various different types of dictionary, using macros to reduce duplication

Additional context

#2135

@tustvold tustvold added enhancement Any new improvement worthy of a entry in the changelog help wanted labels Jul 22, 2022
tustvold added a commit to tustvold/arrow-rs that referenced this issue Aug 3, 2022
tustvold added a commit that referenced this issue Aug 5, 2022
* Add typed dictionary (#2136)

* Review feedback
@alamb alamb added the arrow Changes to the arrow crate label Aug 5, 2022
@alamb alamb changed the title Add TypedDictionaryArray Add TypedDictionaryArray for more ergonomic interaction with DictionaryArray Aug 5, 2022
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 enhancement Any new improvement worthy of a entry in the changelog help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants