MCPcopy Create free account
hub / github.com/bytedance/bolt / writeSpillData

Method writeSpillData

bolt/exec/tests/AsyncSpillerTest.cpp:398–423  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

396 }
397
398 void writeSpillData(const std::vector<RowVectorPtr>& batches) {
399 vector_size_t numRows = 0;
400 for (const auto& batch : batches) {
401 numRows += batch->size();
402 }
403 if (rowVector_ == nullptr) {
404 rowVector_ =
405 BaseVector::create<RowVector>(rowType_, numRows, pool_.get());
406 }
407 rows_.resize(numRows);
408 for (int i = 0; i < numRows; ++i) {
409 rows_[i] = rowContainer_->newRow();
410 }
411
412 vector_size_t nextRow = 0;
413 for (const auto& batch : batches) {
414 rowVector_->append(batch.get());
415 const SelectivityVector allRows(batch->size());
416 for (int index = 0; index < batch->size(); ++index, ++nextRow) {
417 for (int i = 0; i < rowType_->size(); ++i) {
418 DecodedVector decodedVector(*batch->childAt(i), allRows);
419 rowContainer_->store(decodedVector, index, rows_[nextRow], i);
420 }
421 }
422 }
423 }
424
425 void sortSpillData(bool ascending = true) {
426 partitions_.clear();

Callers

nothing calls this directly

Calls 7

childAtMethod · 0.80
sizeMethod · 0.45
getMethod · 0.45
resizeMethod · 0.45
newRowMethod · 0.45
appendMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected