| 185 | } |
| 186 | |
| 187 | void RecordBatch::getColumnByName(libmexclass::proxy::method::Context& context) { |
| 188 | namespace mda = ::matlab::data; |
| 189 | |
| 190 | mda::StructArray args = context.inputs[0]; |
| 191 | const mda::StringArray name_mda = args[0]["Name"]; |
| 192 | const auto name_utf16 = std::u16string(name_mda[0]); |
| 193 | MATLAB_ASSIGN_OR_ERROR_WITH_CONTEXT(const auto name, |
| 194 | arrow::util::UTF16StringToUTF8(name_utf16), context, |
| 195 | error::UNICODE_CONVERSION_ERROR_ID); |
| 196 | |
| 197 | const std::vector<std::string> names = {name}; |
| 198 | const auto& schema = record_batch->schema(); |
| 199 | MATLAB_ERROR_IF_NOT_OK_WITH_CONTEXT(schema->CanReferenceFieldsByNames(names), context, |
| 200 | error::ARROW_TABULAR_SCHEMA_AMBIGUOUS_FIELD_NAME); |
| 201 | |
| 202 | const auto array = record_batch->GetColumnByName(name); |
| 203 | MATLAB_ASSIGN_OR_ERROR_WITH_CONTEXT(context.outputs[0], |
| 204 | arrow::matlab::proxy::wrap_and_manage(array), |
| 205 | context, error::UNKNOWN_PROXY_FOR_ARRAY_TYPE); |
| 206 | } |
| 207 | |
| 208 | void RecordBatch::getSchema(libmexclass::proxy::method::Context& context) { |
| 209 | namespace mda = ::matlab::data; |
nothing calls this directly
no test coverage detected