Skip to content

Commit

Permalink
Fix out of bound
Browse files Browse the repository at this point in the history
  • Loading branch information
PHILO-HE committed Oct 23, 2024
1 parent 6dbe18c commit 33c2ef2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions velox/exec/WindowPartition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,12 @@ void WindowPartition::updateKRangeFrameBounds(
// [0, currentRow] are examined. For following bounds, rows between
// [currentRow, numRows()) are checked.
if (isPreceding) {
start = lastFoundIndex;
start = lastFoundIndex == -1 ? 0 : lastFoundIndex;
end = currentRow + 1;
} else {
start = lastFoundIndex == -1 ? currentRow : lastFoundIndex;
start = lastFoundIndex == -1
? currentRow
: std::min(lastFoundIndex, partition_.size() - 1);
end = partition_.size();
}
rawFrameBounds[i] = searchFrameValue(
Expand Down

0 comments on commit 33c2ef2

Please sign in to comment.