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

Method getRowAsString

matlab/src/cpp/arrow/matlab/tabular/proxy/record_batch.cc:222–239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220}
221
222void RecordBatch::getRowAsString(libmexclass::proxy::method::Context& context) {
223 namespace mda = ::matlab::data;
224 using namespace libmexclass::proxy;
225 mda::ArrayFactory factory;
226
227 mda::StructArray args = context.inputs[0];
228 const mda::TypedArray<int64_t> index_mda = args[0]["Index"];
229 const auto matlab_row_index = int64_t(index_mda[0]);
230
231 MATLAB_ASSIGN_OR_ERROR_WITH_CONTEXT(
232 auto row_str_utf8,
233 arrow::matlab::tabular::get_row_as_string(record_batch, matlab_row_index), context,
234 error::TABULAR_GET_ROW_AS_STRING_FAILED);
235 MATLAB_ASSIGN_OR_ERROR_WITH_CONTEXT(auto row_str_utf16,
236 arrow::util::UTF8StringToUTF16(row_str_utf8),
237 context, error::UNICODE_CONVERSION_ERROR_ID);
238 context.outputs[0] = factory.createScalar(row_str_utf16);
239}
240
241void RecordBatch::exportToC(libmexclass::proxy::method::Context& context) {
242 namespace mda = ::matlab::data;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected