MCPcopy Create free account
hub / github.com/apache/arrow / CombineChunksToBatch

Method CombineChunksToBatch

cpp/src/arrow/table.cc:637–651  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

635}
636
637Result<std::shared_ptr<RecordBatch>> Table::CombineChunksToBatch(MemoryPool* pool) const {
638 ARROW_ASSIGN_OR_RAISE(std::shared_ptr<Table> combined, CombineChunks(pool));
639 std::vector<std::shared_ptr<Array>> arrays;
640 for (const auto& column : combined->columns()) {
641 if (column->num_chunks() == 0) {
642 DCHECK_EQ(num_rows(), 0) << "Empty chunk with more than 0 rows";
643 ARROW_ASSIGN_OR_RAISE(auto chunk,
644 MakeArrayOfNull(column->type(), num_rows(), pool));
645 arrays.push_back(std::move(chunk));
646 } else {
647 arrays.push_back(column->chunk(0));
648 }
649 }
650 return RecordBatch::Make(schema_, num_rows_, std::move(arrays));
651}
652// ----------------------------------------------------------------------
653// Convert a table to a sequence of record batches
654

Callers 4

PopStagedBatchMethod · 0.80
MakeExpectedBatchMethod · 0.80
CheckScannedBatchesMethod · 0.80
acero_test.ccFile · 0.80

Calls 6

columnsMethod · 0.80
push_backMethod · 0.80
num_rowsFunction · 0.70
MakeFunction · 0.70
ARROW_ASSIGN_OR_RAISEFunction · 0.50
num_chunksMethod · 0.45

Tested by 2

MakeExpectedBatchMethod · 0.64
CheckScannedBatchesMethod · 0.64