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

Better ergonomics for FixedSizeList and LargeList #5372

Closed
universalmind303 opened this issue Feb 7, 2024 · 0 comments · Fixed by #5373
Closed

Better ergonomics for FixedSizeList and LargeList #5372

universalmind303 opened this issue Feb 7, 2024 · 0 comments · Fixed by #5373
Labels
arrow Changes to the arrow crate enhancement Any new improvement worthy of a entry in the changelog

Comments

@universalmind303
Copy link
Contributor

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

List and Struct datatypes have some ergonomic utility functions such as DataType::new_list and Field::new_list. LargeList and FixedSizeList should have these same utility functions.

Describe the solution you'd like

// this is verbose and annoying because of the `Arc::new` every time
let dtype = DataType::FixedSizeList(Arc::new(Field::new("item", DataType::Int8, true)), 2);
// this is better and it matches what's provided by `DataType::new_list`
let fsl_dtype = DataType::new_fixed_size_list(DataType::Int8, 2, true);

// should work on fields too
let fld = Field::new_fixed_size_list(
    "f",
    Field::new_list_field(DataType::Int32, false),
    3,
    false,
)

Describe alternatives you've considered

Additional context

@universalmind303 universalmind303 added the enhancement Any new improvement worthy of a entry in the changelog label Feb 7, 2024
@wjones127 wjones127 added the arrow Changes to the arrow crate label Feb 15, 2024
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants