| 396 | |
| 397 | template <typename VectorType> |
| 398 | Status fill_doc_vector(const arrow::BinaryArray *typed_arr, |
| 399 | const std::string &field_name, int dimension, |
| 400 | DocPtrList::iterator doc_it) { |
| 401 | bool no_null = typed_arr->null_count() == 0; |
| 402 | for (int64_t i = 0; i < typed_arr->length(); ++i, ++doc_it) { |
| 403 | if (no_null || !typed_arr->IsNull(i)) { |
| 404 | auto data = typed_arr->GetView(i); |
| 405 | if ((size_t)dimension != data.size() / sizeof(VectorType)) { |
| 406 | return Status::InvalidArgument( |
| 407 | "Vector dimension not match [", field_name, |
| 408 | "]: expected dimension=", dimension, |
| 409 | " vs actual dimension=", data.size() / sizeof(VectorType)); |
| 410 | } |
| 411 | (*doc_it)->set(field_name, std::vector<VectorType>( |
| 412 | (const VectorType *)&data[0], |
| 413 | (const VectorType *)&data[0] + dimension)); |
| 414 | } |
| 415 | } |
| 416 | return Status::OK(); |
| 417 | } |
| 418 | |
| 419 | Status fill_doc_field(const std::shared_ptr<arrow::Array> &chunk, |
| 420 | const FieldSchema &field_schema, |
nothing calls this directly
no test coverage detected