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

Method nextPartition

bolt/exec/TopNRowNumber.cpp:392–422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390 estimatedOutputRowSize_ = rowSize;
391 }
392}
393
394TopNRowNumber::TopRows* TopNRowNumber::nextPartition() {
395 if (!table_) {
396 if (!currentPartition_) {
397 currentPartition_ = 0;
398 return singlePartition_.get();
399 }
400 return nullptr;
401 }
402
403 if (!currentPartition_) {
404 numPartitions_ = table_->listAllRows(
405 &partitionIt_,
406 partitions_.size(),
407 RowContainer::kUnlimited,
408 partitions_.data());
409 if (numPartitions_ == 0) {
410 // No more partitions.
411 return nullptr;
412 }
413
414 currentPartition_ = 0;
415 } else {
416 ++currentPartition_.value();
417 if (currentPartition_ >= numPartitions_) {
418 currentPartition_.reset();
419 return nextPartition();
420 }
421 }
422
423 return &currentPartition();
424}
425

Callers 1

callResetPartitionMethod · 0.45

Calls 6

listAllRowsMethod · 0.80
getMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45
valueMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected