| 653 | |
| 654 | template <RowFormat R> |
| 655 | bool 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 | |
| 699 | template <RowFormat R> |
| 700 | void SpilledWindowPartition<R>::getWindowFunctionResults( |
no test coverage detected