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 db818ef
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion velox/exec/WindowPartition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,23 @@ 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
: std::min(lastFoundIndex, numRows - 1);
} else {
start = currentRow;
}
}
end = partition_.size();
}
rawFrameBounds[i] = searchFrameValue(
Expand Down

0 comments on commit db818ef

Please sign in to comment.