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 limited support for dictionary builders in make_builders for stru… #6593

Merged
merged 3 commits into from
Oct 21, 2024

Conversation

kszlim
Copy link
Contributor

@kszlim kszlim commented Oct 20, 2024

…ct array builders

Which issue does this PR close?

Closes #6589

Rationale for this change

Makes make_builders more useful in general

What changes are included in this PR?

Adds branches to make_builders to support Int32 keys and string + binary values

Are there any user-facing changes?

No api changes, but a larger % of fields will now work with make_builders

@github-actions github-actions bot added the arrow Changes to the arrow crate label Oct 20, 2024
match &**value_type {
DataType::Utf8 => {
let dict_builder: StringDictionaryBuilder<Int32Type> =
StringDictionaryBuilder::with_capacity(capacity, 32, 1024);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure about good default capacity values, @tustvold go ahead and edit them if you don't like them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks to me like the standard capacity is 256 for values in https://github.com/apache/arrow-rs/blob/20433530e7f60fa9ff45ae7c51c3e5ab27c7a2d0/arrow-array/src/array/dictionary_array.rs#L659-L658

I'll push a commit to match that.

@kszlim
Copy link
Contributor Author

kszlim commented Oct 20, 2024

Pretty sure the integration test failure is unrelated, can someone re-run?

@alamb
Copy link
Contributor

alamb commented Oct 21, 2024

CI should be clean after a merge up from main

@alamb alamb changed the title Add limited support for dictionary builders in make_builders for stru… Add limited support for dictionary builders in make_builders for stru… Oct 21, 2024
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me -- thanks @kszlim

@alamb alamb merged commit c6048d5 into apache:master Oct 21, 2024
27 checks passed
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support DataType::Dictionary in make_builder within struct_builder.rs
2 participants