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

Are we sure that removing dict_id is not removing important functionality? #7017

Closed
andygrove opened this issue Jan 24, 2025 · 2 comments
Closed
Labels
question Further information is requested

Comments

@andygrove
Copy link
Member

andygrove commented Jan 24, 2025

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

I started upgrading Comet to use the latest DataFusion/Arrow and saw that an effort is being made to remove dict_id from arrow-rs Field.

It seems odd that arrow-java has dict_id as part of its field representation, but we plan to remove it from arrow-rs.

I am not 100% sure but this may be problematic for Comet since we seem to rely on the dictionary id when passing arrays between Java and Rust. I did not write this code and am not yet familiar with it, but in one example, in Rust we have:

    let mut dict_id = 0;
    let fields = arrays
        .iter()
        .enumerate()
        .map(|(i, array)| match array.data_type() {
            DataType::Dictionary(_, _) => {
                let field = Field::new_dict(
                    format!("c{}", i),
                    array.data_type().clone(),
                    true,
                    dict_id,
                    false,
                );
                dict_id += 1;
                field
            }
            _ => Field::new(format!("c{}", i), array.data_type().clone(), true),
        })

and then in Java:

DictionaryEncoding dictionaryEncoding = vector.getField().getDictionary();
Dictionary dictionary = dictionaryProvider.lookup(dictionaryEncoding.getId());

It will take me some time to get up to speed with how we are using this in Comet, and to determine whether it is needed or not.

Describe the solution you'd like

I would like more discussion on this before the field is removed.

Describe alternatives you've considered

Additional context

@andygrove andygrove added the enhancement Any new improvement worthy of a entry in the changelog label Jan 24, 2025
@andygrove
Copy link
Member Author

@tustvold @alamb @brancz fyi

@tustvold tustvold added question Further information is requested and removed enhancement Any new improvement worthy of a entry in the changelog labels Jan 25, 2025
@tustvold
Copy link
Contributor

In order to keep discussion in one place I am going to merge this with #5981

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

2 participants