apache / arrow

Apache Arrow is a multi-language toolbox for accelerated data interchange and in-memory processing
https://arrow.apache.org/
Apache License 2.0
13.88k stars 3.38k forks source link

[MATLAB] Add support for creating an empty `arrow.tabular.RecordBatch` by calling `arrow.recordBatch` with no input arguments #38211

Open kevingurney opened 8 months ago

kevingurney commented 8 months ago

Describe the enhancement requested

Currently, the arrow.table construction function will return an empty arrow.tabular.Table if no input arguments are passed to the function. However, arrow.recordBatch throws an error in this case. We should consider making arrow.recordBatch behave consistently with arrow.table in this case.

This should be relatively straightforward to implement. We can just set the input argument T to default to table.empty(0,0) in the arguments block of the recordBatch function, in the same way that arrow.table does:

https://github.com/apache/arrow/blob/73454b7040fbea3a187c1bfabd7ea02d46ca3c41/matlab/src/matlab/%2Barrow/table.m#L21

Component(s)

MATLAB

Divyansh200102 commented 8 months ago

take