MCPcopy Create free account
hub / github.com/apache/arrow / import

Method import

matlab/src/cpp/arrow/matlab/c/proxy/array_importer.cc:34–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34void ArrayImporter::import(libmexclass::proxy::method::Context& context) {
35 namespace mda = ::matlab::data;
36
37 mda::StructArray args = context.inputs[0];
38 const mda::TypedArray<uint64_t> arrow_array_address_mda = args[0]["ArrowArrayAddress"];
39 const mda::TypedArray<uint64_t> arrow_schema_address_mda =
40 args[0]["ArrowSchemaAddress"];
41
42 const auto arrow_array_address = uint64_t(arrow_array_address_mda[0]);
43 const auto arrow_schema_address = uint64_t(arrow_schema_address_mda[0]);
44
45 auto arrow_array = reinterpret_cast<struct ArrowArray*>(arrow_array_address);
46 auto arrow_schema = reinterpret_cast<struct ArrowSchema*>(arrow_schema_address);
47
48 MATLAB_ASSIGN_OR_ERROR_WITH_CONTEXT(auto array,
49 arrow::ImportArray(arrow_array, arrow_schema),
50 context, error::C_IMPORT_FAILED);
51
52 MATLAB_ASSIGN_OR_ERROR_WITH_CONTEXT(context.outputs[0],
53 arrow::matlab::proxy::wrap_and_manage(array),
54 context, error::UNKNOWN_PROXY_FOR_ARRAY_TYPE);
55}
56
57} // namespace arrow::matlab::c::proxy

Callers 9

test_exportMethod · 0.45
test_exportMethod · 0.45
test_exportMethod · 0.45
test_exportMethod · 0.45
test_exportMethod · 0.45
test_export_importMethod · 0.45
test_exportMethod · 0.45
test_exportMethod · 0.45
test_exportMethod · 0.45

Calls 1

wrap_and_manageFunction · 0.85

Tested by 9

test_exportMethod · 0.36
test_exportMethod · 0.36
test_exportMethod · 0.36
test_exportMethod · 0.36
test_exportMethod · 0.36
test_export_importMethod · 0.36
test_exportMethod · 0.36
test_exportMethod · 0.36
test_exportMethod · 0.36