Skip to content

Strongly Typed Array Slicing #3929

@tustvold

Description

@tustvold

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

Currently calling Array::slice returns an ArrayRef, even if calling on a strongly typed array. This results in a lot of code of the form

let a = Int32Array::from(vec![Some(15), None, Some(9), Some(8), None]);
let a = a.slice(1, 4);
let a = a.as_primitive();

This is not only verbose but has potential performance implications.

Describe the solution you'd like

Arrays should provide Array::slice(&self, offset: usize, len: usize) -> Self

Describe alternatives you've considered

Additional context

Part of #3880

Metadata

Metadata

Assignees

No one assigned

    Labels

    arrowChanges to the arrow crateenhancementAny new improvement worthy of a entry in the changelogparquetChanges to the parquet crate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions