Skip to content
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-36250: [MATLAB] Add arrow.array.StringArray class #36366

Merged
merged 17 commits into from
Jul 7, 2023
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
8240f3e
Convert UTF-16 encoded MATLAB string values to UTF-8.
kevingurney Jun 26, 2023
0237bde
Factor out code for getting const uint8_t* from a logical MATLAB Data…
kevingurney Jun 26, 2023
68a2d0b
Register StringArray with Proxy factory.
kevingurney Jun 28, 2023
c1fd7c5
1. Implement toMATLAB for StringArray Proxy.
kevingurney Jun 28, 2023
7ba25cf
Add basic code for MATLAB StringArray class.
kevingurney Jun 28, 2023
13de230
1. Fix bug in StringArray constructor.
kevingurney Jun 29, 2023
888bfa3
Update SupportedTypes test case in tRecordBatch test class to include…
kevingurney Jun 29, 2023
8fb3eeb
Static cast array length to size_t.
kevingurney Jun 27, 2023
869dbfd
Substitute MATLAB string(missing) values with the empty string value
kevingurney Jun 27, 2023
e596211
Add test case which verifies that MATLAB string(missing) values are
kevingurney Jun 27, 2023
a465889
Add support for constructing StringArray from a cell array of strings.
kevingurney Jun 27, 2023
5b0a07c
1. Add tests for construction of StringArray from cellstr.
kevingurney Jun 27, 2023
b07a50d
Add NumBuffers and NumFields properties to arrow.type.StringType.
kevingurney Jun 28, 2023
feaf7a0
Use std::move when creating array of strings to avoid unnecessary dat…
kevingurney Jul 5, 2023
4e21e6a
Rename unpacked_as_ptr to extract_ptr.
kevingurney Jul 5, 2023
44855a6
Do not convert the empty sting ("") from UTF-16 to UTF-8.
kevingurney Jul 5, 2023
588a0f6
Use GetView() instead of GetString()
sgilmore10 Jul 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Register StringArray with Proxy factory.
Co-authored-by: Sarah Gilmore <sgilmore@mathworks.com>
kevingurney and sgilmore10 committed Jul 6, 2023
commit 68a2d0bdfcdcdb44f1ad6d7bd0a56d086a97399b
4 changes: 3 additions & 1 deletion matlab/src/cpp/arrow/matlab/proxy/factory.cc
Original file line number Diff line number Diff line change
@@ -17,8 +17,9 @@

#include "arrow/matlab/array/proxy/boolean_array.h"
#include "arrow/matlab/array/proxy/numeric_array.h"
#include "arrow/matlab/tabular/proxy/record_batch.h"
#include "arrow/matlab/array/proxy/string_array.h"
#include "arrow/matlab/array/proxy/timestamp_array.h"
#include "arrow/matlab/tabular/proxy/record_batch.h"
#include "arrow/matlab/error/error.h"

#include "factory.h"
@@ -37,6 +38,7 @@ libmexclass::proxy::MakeResult Factory::make_proxy(const ClassName& class_name,
REGISTER_PROXY(arrow.array.proxy.Int32Array , arrow::matlab::array::proxy::NumericArray<int32_t>);
REGISTER_PROXY(arrow.array.proxy.Int64Array , arrow::matlab::array::proxy::NumericArray<int64_t>);
REGISTER_PROXY(arrow.array.proxy.BooleanArray , arrow::matlab::array::proxy::BooleanArray);
REGISTER_PROXY(arrow.array.proxy.StringArray , arrow::matlab::array::proxy::StringArray);
REGISTER_PROXY(arrow.array.proxy.TimestampArray, arrow::matlab::array::proxy::TimestampArray);
REGISTER_PROXY(arrow.tabular.proxy.RecordBatch , arrow::matlab::tabular::proxy::RecordBatch);
return libmexclass::error::Error{error::UNKNOWN_PROXY_ERROR_ID, "Did not find matching C++ proxy for " + class_name};
3 changes: 2 additions & 1 deletion matlab/tools/cmake/BuildMatlabArrowInterface.cmake
Original file line number Diff line number Diff line change
@@ -42,8 +42,9 @@ set(MATLAB_ARROW_LIBMEXCLASS_CLIENT_PROXY_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/src/c

set(MATLAB_ARROW_LIBMEXCLASS_CLIENT_PROXY_SOURCES "${CMAKE_SOURCE_DIR}/src/cpp/arrow/matlab/array/proxy/array.cc"
"${CMAKE_SOURCE_DIR}/src/cpp/arrow/matlab/array/proxy/boolean_array.cc"
"${CMAKE_SOURCE_DIR}/src/cpp/arrow/matlab/tabular/proxy/record_batch.cc"
"${CMAKE_SOURCE_DIR}/src/cpp/arrow/matlab/array/proxy/string_array.cc"
"${CMAKE_SOURCE_DIR}/src/cpp/arrow/matlab/array/proxy/timestamp_array.cc"
"${CMAKE_SOURCE_DIR}/src/cpp/arrow/matlab/tabular/proxy/record_batch.cc"
"${CMAKE_SOURCE_DIR}/src/cpp/arrow/matlab/bit/pack.cc"
"${CMAKE_SOURCE_DIR}/src/cpp/arrow/matlab/bit/unpack.cc"
"${CMAKE_SOURCE_DIR}/src/cpp/arrow/matlab/type/time_unit.cc")