summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/pipeline/window_function/window_function_exec.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/pipeline/window_function/window_function_exec.cpp b/src/mongo/db/pipeline/window_function/window_function_exec.cpp
index 0f144f930da..2bbb520dfa7 100644
--- a/src/mongo/db/pipeline/window_function/window_function_exec.cpp
+++ b/src/mongo/db/pipeline/window_function/window_function_exec.cpp
@@ -145,17 +145,19 @@ std::unique_ptr<WindowFunctionExec> WindowFunctionExec::create(
part.fieldPath != boost::none && !part.expression);
auto sortByExpr = ExpressionFieldPath::createPathFromString(
expCtx, part.fieldPath->fullPath(), expCtx->variablesParseState);
+
+ auto inputExpr = translateInputExpression(functionStmt.expr, sortBy);
if (stdx::holds_alternative<WindowBounds::Unbounded>(rangeBounds.lower)) {
return std::make_unique<WindowFunctionExecNonRemovableRange>(
iter,
- functionStmt.expr->input(),
+ inputExpr,
std::move(sortByExpr),
functionStmt.expr->buildAccumulatorOnly(),
bounds);
} else {
return std::make_unique<WindowFunctionExecRemovableRange>(
iter,
- functionStmt.expr->input(),
+ inputExpr,
std::move(sortByExpr),
functionStmt.expr->buildRemovable(),
bounds);