| 984 | } |
| 985 | |
| 986 | RowVectorPtr 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 | |
| 1027 | bool Window::isSpillableWindowBuild() { |
| 1028 | static std::map<std::string, bool> supportedAggFunc{ |
nothing calls this directly
no test coverage detected