From 954206b462685a10088d6a184a40bc5e7b65d900 Mon Sep 17 00:00:00 2001 From: feiniaofeiafei Date: Mon, 9 Dec 2024 15:23:22 +0800 Subject: [PATCH] fix second parameter of first_value/second_value is not constant leading to be core --- .../doris/nereids/rules/analysis/WindowFunctionChecker.java | 2 +- regression-test/suites/nereids_syntax_p0/window_function.groovy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/WindowFunctionChecker.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/WindowFunctionChecker.java index c896c217e19c9a8..a602649ec31a6a9 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/WindowFunctionChecker.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/WindowFunctionChecker.java @@ -351,7 +351,7 @@ public FirstOrLastValue visitFirstValue(FirstValue firstValue, Void ctx) { @Override public FirstOrLastValue visitLastValue(LastValue lastValue, Void ctx) { if (2 == lastValue.arity() && !lastValue.child(1).isConstant()) { - throw new AnalysisException("The second parameter of lasst_value must be constant"); + throw new AnalysisException("The second parameter of last_value must be constant"); } return lastValue; } diff --git a/regression-test/suites/nereids_syntax_p0/window_function.groovy b/regression-test/suites/nereids_syntax_p0/window_function.groovy index 39f6cc3cfea84e9..a07a79b5e8ebbd8 100644 --- a/regression-test/suites/nereids_syntax_p0/window_function.groovy +++ b/regression-test/suites/nereids_syntax_p0/window_function.groovy @@ -288,6 +288,6 @@ suite("window_function") { test { sql "select last_value(c1,c1) over() from window_test" - exception "The second parameter of first_value must be constant" + exception "The second parameter of last_value must be constant" } }