| 454 | |
| 455 | template <class PROCESS_VALUE_FN> |
| 456 | void ExecBatchBuilder::Visit(const std::shared_ptr<ArrayData>& column, int num_rows, |
| 457 | const uint16_t* row_ids, PROCESS_VALUE_FN process_value_fn) { |
| 458 | KeyColumnMetadata metadata = ColumnMetadataFromDataType(column->type).ValueOrDie(); |
| 459 | |
| 460 | if (!metadata.is_fixed_length) { |
| 461 | const uint8_t* ptr_base = column->buffers[2]->data(); |
| 462 | const int32_t* offsets = column->GetValues<int32_t>(1); |
| 463 | for (int i = 0; i < num_rows; ++i) { |
| 464 | uint16_t row_id = row_ids[i]; |
| 465 | const uint8_t* field_ptr = ptr_base + offsets[row_id]; |
| 466 | int32_t field_length = offsets[row_id + 1] - offsets[row_id]; |
| 467 | process_value_fn(i, field_ptr, field_length); |
| 468 | } |
| 469 | } else { |
| 470 | ARROW_DCHECK(metadata.fixed_length > 0); |
| 471 | for (int i = 0; i < num_rows; ++i) { |
| 472 | uint16_t row_id = row_ids[i]; |
| 473 | const uint8_t* field_ptr = |
| 474 | column->buffers[1]->data() + |
| 475 | (column->offset + row_id) * static_cast<int64_t>(metadata.fixed_length); |
| 476 | process_value_fn(i, field_ptr, static_cast<int32_t>(metadata.fixed_length)); |
| 477 | } |
| 478 | } |
| 479 | } |
| 480 | |
| 481 | Status ExecBatchBuilder::AppendSelected(const std::shared_ptr<ArrayData>& source, |
| 482 | ResizableArrayData* target, |
nothing calls this directly
no test coverage detected