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

Method noMoreInputCommon

bolt/exec/WindowBuild.cpp:186–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186void WindowBuild::noMoreInputCommon() {
187 if (numRows_ == 0) {
188 return;
189 }
190
191 if (sortSpiller_ != nullptr) {
192 // Spill remaining data to avoid running out of memory while sort-merging
193 // spilled data.
194 sortSpill();
195
196 BOLT_CHECK_NULL(sortMerge_);
197 BOLT_CHECK_NULL(rowBasedSpillSortMerger_);
198 auto spillPartition = sortSpiller_->finishSpill();
199 if (spillConfig_->rowBasedSpillMode == common::RowBasedSpillMode::DISABLE) {
200 sortMerge_ = spillPartition.createOrderedReader(pool_);
201 } else {
202 rowBasedSpillSortMerger_ =
203 spillPartition.createRowBasedOrderedReaderWithLength(
204 pool_,
205 data_.get(),
206 spillConfig_->getJITenabledForSpill(),
207 spillConfig_->spillUringEnabled);
208 }
209
210 } else {
211 // At this point we have seen all the input rows. The operator is
212 // being prepared to output rows now.
213 // To prepare the rows for output in SortWindowBuild they need to
214 // be separated into partitions and sort by ORDER BY keys within
215 // the partition. This will order the rows for getOutput().
216 updateEstimatedOutputRowSize();
217 sortPartitions();
218 return;
219 }
220}
221
222void WindowBuild::sortPartitions() {
223 sortRows_.resize(numRows_);

Callers 1

noMoreInputMethod · 0.80

Calls 5

createOrderedReaderMethod · 0.80
getJITenabledForSpillMethod · 0.80
finishSpillMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected