| 136 | } |
| 137 | |
| 138 | void RecordBatch::getColumnNames(libmexclass::proxy::method::Context& context) { |
| 139 | namespace mda = ::matlab::data; |
| 140 | mda::ArrayFactory factory; |
| 141 | const int num_columns = record_batch->num_columns(); |
| 142 | |
| 143 | std::vector<mda::MATLABString> column_names; |
| 144 | for (int i = 0; i < num_columns; ++i) { |
| 145 | const auto column_name_utf8 = record_batch->column_name(i); |
| 146 | MATLAB_ASSIGN_OR_ERROR_WITH_CONTEXT(auto column_name_utf16, |
| 147 | arrow::util::UTF8StringToUTF16(column_name_utf8), |
| 148 | context, error::UNICODE_CONVERSION_ERROR_ID); |
| 149 | const mda::MATLABString matlab_string = |
| 150 | mda::MATLABString(std::move(column_name_utf16)); |
| 151 | column_names.push_back(matlab_string); |
| 152 | } |
| 153 | auto column_names_mda = |
| 154 | factory.createArray({size_t{1}, static_cast<size_t>(num_columns)}, |
| 155 | column_names.begin(), column_names.end()); |
| 156 | context.outputs[0] = column_names_mda; |
| 157 | } |
| 158 | |
| 159 | void RecordBatch::getColumnByIndex(libmexclass::proxy::method::Context& context) { |
| 160 | namespace mda = ::matlab::data; |
nothing calls this directly
no test coverage detected