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

Method getBatch

bolt/exec/WindowPartition.cpp:655–697  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

653
654template <RowFormat R>
655bool SpilledWindowPartition<R>::getBatch(RowVectorPtr& output, bool& isEnd) {
656 bool ret = false;
657 RowVectorPtr tmpBatch;
658 isEnd = false;
659
660 if constexpr (R == RowFormat::kSerializedRows) {
661 std::vector<char*> tmpRows;
662 output = nullptr;
663 ret = merge_->nextBatch(tmpRows);
664 output = std::static_pointer_cast<RowVector>(
665 BaseVector::create(outputType_, tmpRows.size(), pool_));
666 if (LIKELY(ret)) {
667 for (auto i = 0; i < outputChannels_->size(); i++) {
668 rowToColumnVector(
669 tmpRows.data(),
670 tmpRows.size(),
671 this->columns_[i],
672 0,
673 output->childAt(i));
674 }
675
676 processedRows_ += output->size();
677 isEnd = (processedRows_ == numRows_);
678 }
679 } else {
680 ret = merge_->nextBatch(tmpBatch);
681 if (LIKELY(ret)) {
682 std::vector<VectorPtr> children(tmpBatch->childrenSize());
683 for (auto i = 0; i < outputChannels_->size(); ++i) {
684 children[(*outputChannels_)[i]] = tmpBatch->childAt(i);
685 }
686 output = std::make_shared<RowVector>(
687 pool_,
688 outputType_,
689 BufferPtr(nullptr),
690 tmpBatch->size(),
691 std::move(children));
692 processedRows_ += output->size();
693 isEnd = (processedRows_ == numRows_);
694 }
695 }
696 return ret;
697}
698
699template <RowFormat R>
700void SpilledWindowPartition<R>::getWindowFunctionResults(

Callers 1

Calls 8

LIKELYFunction · 0.85
rowToColumnVectorFunction · 0.85
childAtMethod · 0.80
createFunction · 0.50
nextBatchMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45
childrenSizeMethod · 0.45

Tested by

no test coverage detected