-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH-37340: [MATLAB] The column(index)
method of arrow.tabular.RecordBatch
errors if index
refers to an arrow.array.Time32Array
column
#37347
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…classes of arrow.array.Array
…ist of concrete arrow.array.Array subclasses
kevingurney
requested changes
Aug 23, 2023
matlab/src/matlab/+arrow/+internal/+test/+tabular/createAllSupportedArrayTypes.m
Outdated
Show resolved
Hide resolved
matlab/src/matlab/+arrow/+internal/+test/+tabular/createAllSupportedArrayTypes.m
Show resolved
Hide resolved
github-actions
bot
added
awaiting changes
Awaiting changes
and removed
awaiting review
Awaiting review
labels
Aug 23, 2023
github-actions
bot
added
awaiting change review
Awaiting change review
and removed
awaiting changes
Awaiting changes
labels
Aug 23, 2023
kevingurney
approved these changes
Aug 23, 2023
github-actions
bot
added
awaiting merge
Awaiting merge
and removed
awaiting change review
Awaiting change review
labels
Aug 23, 2023
+1 |
After merging your PR, Conbench analyzed the 5 benchmarking runs that have been run so far on merge-commit 91a4927. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about possible false positives for unstable benchmarks that are known to sometimes produce them. |
loicalleyne
pushed a commit
to loicalleyne/arrow
that referenced
this pull request
Nov 13, 2023
….RecordBatch` errors if `index` refers to an `arrow.array.Time32Array` column (apache#37347) ### Rationale for this change The `column(index)` method of `arrow.tabular.RecordBatch` errors if `index` refers to an `arrow.array.Time32Array` column. ```matlab >> string = arrow.array(["A", "B", "C"]); >> time32 = arrow.array.Time32Array.fromMATLAB(seconds(1:3)); >> rb = arrow.tabular.RecordBatch.fromArrays(string, time32, ColumnNames=["String", "Time32"]) rb = String: [ "A", "B", "C" ] Time32: [ 00:00:01, 00:00:02, 00:00:03 ] >> time32Column = rb.column(2) Error using . Unsupported DataType: time32[s] Error in arrow.tabular.RecordBatch/column (line 63) [proxyID, typeID] = obj.Proxy.getColumnByIndex(args); ``` `column(index)` is throwing this error because the case for `Time32` was not added to `arrow::matlab::array::proxy::wrap(arrowArray)` in apache#37315. `column(index)` calls this function to create proxy objects around existing arrow arrays. Adding the case for `Time32` will resolve this bug. ### What changes are included in this PR? 1. Updated `arrow::Result<proxy::Array> wrap(const std::shared_ptr<arrow::Array>& array)` to handle wrapping `arrow::Time32Array` instances within `proxy::Time32Array`s. 2. Added a new test utility called `arrow.internal.test.tabular.createAllSupportedArrayTypes`, which returns two cell arrays: `arrowArrays` and `matlabData`. The `arrowArrays` cell array contains one instance of each concrete subclass of `arrow.array.Array`. The `matlabData` cell array contains the MATLAB arrays used to generate each array in `arrowArrays`. This utility can be used to create an `arrow.array.RecordBatch` that contains all the arrow array types that are supported by the MATLAB interface. ### Are these changes tested? Yes. Updated the `fromArrays` test cases in `tRecordBatch` to verify the `column(index)` method of `arrow.type.RecordBatch` supports extracting columns of any arrow type (supported by the MATLAB Interface). ### Are there any user-facing changes? Yes. Fixed a bug in `arrow.tabular.RecordBatch`. ### Future Directions 1. apache#37345 * Closes: apache#37340 Authored-by: Sarah Gilmore <[email protected]> Signed-off-by: Kevin Gurney <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rationale for this change
The
column(index)
method ofarrow.tabular.RecordBatch
errors ifindex
refers to anarrow.array.Time32Array
column.column(index)
is throwing this error because the case forTime32
was not added toarrow::matlab::array::proxy::wrap(arrowArray)
in #37315.column(index)
calls this function to create proxy objects around existing arrow arrays. Adding the case forTime32
will resolve this bug.What changes are included in this PR?
arrow::Result<proxy::Array> wrap(const std::shared_ptr<arrow::Array>& array)
to handle wrappingarrow::Time32Array
instances withinproxy::Time32Array
s.arrow.internal.test.tabular.createAllSupportedArrayTypes
, which returns two cell arrays:arrowArrays
andmatlabData
. ThearrowArrays
cell array contains one instance of each concrete subclass ofarrow.array.Array
. ThematlabData
cell array contains the MATLAB arrays used to generate each array inarrowArrays
. This utility can be used to create anarrow.array.RecordBatch
that contains all the arrow array types that are supported by the MATLAB interface.Are these changes tested?
Yes. Updated the
fromArrays
test cases intRecordBatch
to verify thecolumn(index)
method ofarrow.type.RecordBatch
supports extracting columns of any arrow type (supported by the MATLAB Interface).Are there any user-facing changes?
Yes. Fixed a bug in
arrow.tabular.RecordBatch
.Future Directions
fromMATLAB
static construction methods toTypeTraits
classes #37345column(index)
method ofarrow.tabular.RecordBatch
errors ifindex
refers to anarrow.array.Time32Array
column #37340