Commits


Kevin Gurney authored and GitHub committed ef02417d40a
GH-37592: [MATLAB] Add `NumRows` property to `arrow.tabular.RecordBatch` (#38215) ### Rationale for this change Currently, there is a `NumColumns` property on `arrow.tabular.RecordBatch`, but no `NumRows` property. It would be useful to be able to query the number of rows in a `RecordBatch`. This pull request adds a `NumRows` property to `arrow.tabular.RecordBatch` to mirror the design of `arrow.tabular.Table`. ### What changes are included in this PR? 1. Added new `NumRows` property to `arrow.tabular.RecordBatch` **Example** ```matlab >> matlabTable = array2table(rand(10, 5)) matlabTable = 10x5 table Var1 Var2 Var3 Var4 Var5 ________ ________ _______ _______ ________ 0.76062 0.12009 0.98898 0.29974 0.42165 0.64994 0.85116 0.71768 0.58693 0.31061 0.33593 0.87823 0.87766 0.38206 0.45742 0.031364 0.8336 0.71528 0.14987 0.3618 0.5986 0.81193 0.25784 0.21073 0.76715 0.46493 0.40281 0.39729 0.16737 0.94521 0.18738 0.16351 0.46437 0.45545 0.40774 0.67682 0.3577 0.94882 0.1295 0.022501 0.29368 0.47122 0.99682 0.46011 0.34275 0.6849 0.064717 0.89719 0.38302 0.4523 >> arrowRecordBatch = arrow.recordBatch(matlabTable); >> arrowRecordBatch.NumRows ans = int64 10 ``` ### Are these changes tested? Yes. 1. Added `NumRows` test to `tRecordBatch` test class. 3. Updated `EmptyTable` test (renamed to `EmptyRecordBatch`) in `tRecordBatch` test class. 4. Added `FromArraysNoInputs` test to mirror the `FromArraysNoInputs` test in `tTable` test class. ### Are there any user-facing changes? Yes. This pull request adds a new public `NumRows` property to the `arrow.tabular.RecordBatch` class. Users can query the number of rows in an `arrow.tabular.RecordBatch` by accessing the `NumRows` property. ### Future Directions 1. #38214 3. #38213 * Closes: #37592 Authored-by: Kevin Gurney <kgurney@mathworks.com> Signed-off-by: Kevin Gurney <kgurney@mathworks.com>