Skip to content

Commit

Permalink
Erase the previous processed window partition when begin handle the …
Browse files Browse the repository at this point in the history
…next partition
  • Loading branch information
JkSelf committed Sep 25, 2024
1 parent 4e45bc5 commit 4e2217e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions velox/exec/RowsStreamingWindowBuild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@ void RowsStreamingWindowBuild::noMoreInput() {

std::shared_ptr<WindowPartition> RowsStreamingWindowBuild::nextPartition() {
VELOX_CHECK(hasNextPartition());

if (outputPartition_ > 0) {
windowPartitions_.erase(
windowPartitions_.begin(), windowPartitions_.begin() + 1);
windowPartitions_.shrink_to_fit();
--outputPartition_;
--inputPartition_;
}

return windowPartitions_[++outputPartition_];
}

Expand Down

0 comments on commit 4e2217e

Please sign in to comment.