From 1c8ebac9a87297a49c566f5f03c6d5d786d4b34e Mon Sep 17 00:00:00 2001 From: PHILO-HE Date: Tue, 27 Feb 2024 21:29:17 +0800 Subject: [PATCH] Initial commit --- velox/exec/Window.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/velox/exec/Window.cpp b/velox/exec/Window.cpp index 303fa045e5e83..b2cbd4397ce0c 100644 --- a/velox/exec/Window.cpp +++ b/velox/exec/Window.cpp @@ -300,8 +300,16 @@ void Window::updateKRowsFrameBounds( if (frameArg.index == kConstantChannel) { auto constantOffset = frameArg.constant.value(); auto startValue = - startRow + (isKPreceding ? -constantOffset : constantOffset); - std::iota(rawFrameBounds, rawFrameBounds + numRows, startValue); + (isKPreceding ? -constantOffset : constantOffset) + startRow; + // std::iota(rawFrameBounds, rawFrameBounds + numRows, startValue); + for (int i = 0; i < numRows; i++) { + if (startValue != (int32_t)startValue) { + std::fill(rawFrameBounds + i, rawFrameBounds + numRows, startValue - 1); + } else { + *(rawFrameBounds + i) = startValue; + } + startValue = startValue + 1; + } } else { currentPartition_->extractColumn( frameArg.index, partitionOffset_, numRows, 0, frameArg.value);