Skip to content

Better ergonomics for FixedSizeList and LargeList #5372

Closed
@universalmind303

Description

@universalmind303

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    arrowChanges to the arrow crateenhancementAny new improvement worthy of a entry in the changelog

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions