Skip to content

Commit

Permalink
Opt following logic
Browse files Browse the repository at this point in the history
  • Loading branch information
PHILO-HE committed Dec 10, 2024
1 parent d75d2c1 commit aa67d02
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion velox/exec/WindowPartition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,21 @@ void WindowPartition::updateKRangeFrameBounds(
} else {
// start = lastFoundIndex == -1 ? currentRow
// : std::min(lastFoundIndex, numRows - 1);
start = currentRow;
if (i == 0) {
start = currentRow;
} else {
auto compareResult = data_->compare(
partition_[currentRow - 1],
partition_[currentRow],
mappedFrameColumn,
mappedFrameColumn,
flags);
if (compareResult <= 0) {
start = lastFoundIndex == -1 ? currentRow : lastFoundIndex;
} else {
start = currentRow;
}
}
end = partition_.size();
}
rawFrameBounds[i] = searchFrameValue(
Expand Down

0 comments on commit aa67d02

Please sign in to comment.