Skip to content

Commit

Permalink
Initial
Browse files Browse the repository at this point in the history
  • Loading branch information
PHILO-HE committed Oct 17, 2024
1 parent 47a9328 commit 4103da5
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 @@ -363,6 +363,7 @@ void WindowPartition::updateKRangeFrameBounds(

vector_size_t start = 0;
vector_size_t end;
vector_size_t lastFoundIndex = isPreceding ? 0 : partition_.size();
// frameColumn is a column index into the original input rows, while
// orderByColumn is a column index into rows in data_ after the columns are
// reordered as per inputMapping_.
Expand Down Expand Up @@ -398,10 +399,10 @@ void WindowPartition::updateKRangeFrameBounds(
// [0, currentRow] are examined. For following bounds, rows between
// [currentRow, numRows()) are checked.
if (isPreceding) {
start = 0;
start = lastFoundIndex;
end = currentRow + 1;
} else {
start = currentRow;
start = lastFoundIndex;
end = partition_.size();
}
rawFrameBounds[i] = searchFrameValue(
Expand All @@ -412,6 +413,7 @@ void WindowPartition::updateKRangeFrameBounds(
orderByColumn,
mappedFrameColumn,
flags);
lastFoundIndex = rawFrameBounds[i];
}
}
}
Expand Down

0 comments on commit 4103da5

Please sign in to comment.