| 554 | } |
| 555 | |
| 556 | bool ArrowRelTable::readArrowValueAtOffset(const ArrowSchemaWrapper& arrowSchema, |
| 557 | const std::vector<ArrowArrayWrapper>& arrowArrays, const std::vector<size_t>& startOffsets, |
| 558 | int64_t columnIdx, offset_t rowOffset, ValueVector& outputVector, uint64_t dstOffset) const { |
| 559 | if (columnIdx < 0 || arrowArrays.empty() || startOffsets.size() != arrowArrays.size()) { |
| 560 | return false; |
| 561 | } |
| 562 | for (size_t batchIdx = 0; batchIdx < arrowArrays.size(); ++batchIdx) { |
| 563 | const auto& batch = arrowArrays[batchIdx]; |
| 564 | auto batchLength = getArrowBatchLength(batch); |
| 565 | auto batchStart = startOffsets[batchIdx]; |
| 566 | if (rowOffset < batchStart || rowOffset >= batchStart + batchLength) { |
| 567 | continue; |
| 568 | } |
| 569 | auto rowInBatch = rowOffset - batchStart; |
| 570 | auto numChildren = batch.n_children < 0 ? 0u : static_cast<uint64_t>(batch.n_children); |
| 571 | if (static_cast<uint64_t>(columnIdx) >= numChildren || !batch.children || |
| 572 | !arrowSchema.children || !batch.children[columnIdx] || |
| 573 | !arrowSchema.children[columnIdx]) { |
| 574 | return false; |
| 575 | } |
| 576 | auto* childArray = batch.children[columnIdx]; |
| 577 | auto* childSchema = arrowSchema.children[columnIdx]; |
| 578 | readSingleArrowValue(childSchema, childArray, outputVector, childArray->offset + rowInBatch, |
| 579 | dstOffset); |
| 580 | return true; |
| 581 | } |
| 582 | return false; |
| 583 | } |
| 584 | |
| 585 | std::vector<int64_t> ArrowRelTable::getOutputToArrowColumnIdx( |
| 586 | const std::vector<column_id_t>& columnIDs) const { |
nothing calls this directly
no test coverage detected