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

Method getOutputFromSpilledPartition

bolt/exec/Window.cpp:986–1025  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

984}
985
986RowVectorPtr Window::getOutputFromSpilledPartition() {
987 RowVectorPtr spilledOutput;
988 bool isEnd;
989 if (LIKELY(currentPartition_->getBatch(spilledOutput, isEnd))) {
990 auto numOutputRows = spilledOutput->size();
991 BOLT_DCHECK(numOutputRows > 0);
992 std::vector<VectorPtr> children;
993 // input columns
994 children.insert(
995 children.end(),
996 spilledOutput->children().begin(),
997 spilledOutput->children().end());
998 // window function columns
999 for (auto w = 0; w < windowResultTypes_.size(); ++w) {
1000 auto child = BaseVector::create(
1001 windowResultTypes_[w], numOutputRows, operatorCtx_->pool());
1002 currentPartition_->getWindowFunctionResults(
1003 child, numOutputRows, w, windowBuild_->isAggWindowFunc());
1004 children.emplace_back(std::move(child));
1005 }
1006 numProcessedRows_ += numOutputRows;
1007 if (isEnd) {
1008 windowBuild_->resetSpiller();
1009 callResetPartition();
1010 }
1011 return std::make_shared<RowVector>(
1012 operatorCtx_->pool(),
1013 outputType_,
1014 BufferPtr(nullptr),
1015 numOutputRows,
1016 std::move(children));
1017 } else {
1018 // no more batch from spilled file
1019 // for SpillableWindowBuild, need to set spiller_ to nullptr
1020 // or needsInput will not consume more data
1021 windowBuild_->resetSpiller();
1022 callResetPartition();
1023 return nullptr;
1024 }
1025}
1026
1027bool Window::isSpillableWindowBuild() {
1028 static std::map<std::string, bool> supportedAggFunc{

Callers

nothing calls this directly

Calls 12

LIKELYFunction · 0.85
createFunction · 0.50
getBatchMethod · 0.45
sizeMethod · 0.45
insertMethod · 0.45
endMethod · 0.45
beginMethod · 0.45
childrenMethod · 0.45
poolMethod · 0.45
isAggWindowFuncMethod · 0.45
resetSpillerMethod · 0.45

Tested by

no test coverage detected