sgilmore10 opened a new issue, #37618:
URL: https://github.com/apache/arrow/issues/37618
### Describe the enhancement requested
Currently, there is no easy way to extract multiple `arrow.type.Field`s from
an `arrow.tabular.Schema` object into a single, nonscalar array. Currently, the
only way to do so is to iterate over the number of fields in the `Schema`, call
`field` with each index value, and then concatenate the fields together into
one array:
```matlab
% Create a RecordBatch
>> t = table(1, true, datetime("now"), seconds(1), VariableNames=["Number",
"Logical", "Date", "Time"]);
>> rb = arrow.recordBatch(t);
% Extract the RecordBatch's Schema
>> schema = rb.Schema;
% Create the 4x1 Field array
>> fieldCellArray = cell([1 schema.NumFields]);
>> for ii = 1:schema.NumFields
fieldCellArray{ii} = schema.field(ii);
end
>> fields = vertcat(fieldCellArray{:})
fields =
4×1 Field array with properties:
Name
Type
```
We should add a `Field` property to `arrow.tabular.Schema` that is a 1xN
`arrow.type.Field` array.
### Component(s)
MATLAB
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]