Skip to content

[MATLAB] Add validation logic for offsets and values to arrow.array.ListArray.fromArrays #38361

Description

@kevingurney

Describe the enhancement requested

Currently,arrow.array.ListArray.fromArrays does not validate the supplied offsets and values to ensure that they represent a valid list. This can result in ListArrays that look like the following:

>> offsets=arrow.array(int32([0, 2, 3, 7, 100])) offsets = [
0,
2,
3,
7,
100
]
>> values=arrow.array(["A", "B", "C", "D", "E", "F", "G"]) values = [
"A",
"B",
"C",
"D",
"E",
"F",
"G"
]
>> arrowArray=arrow.array.ListArray.fromArrays(offsets, values)
arrowArray = <Invalidarray:Lengthspannedbylist offsets (100) largerthanvalues array (length7)>

We should add support for validating offsets and values to arrow.array.ListArray.fromArrays and potentially provide a name-value pair like ValidateList = true | false to the fromArrays method to let client code control whether or not they want to pay the cost of validation.

Component(s)

MATLAB

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions