Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

window function: function name of error message should be lowercase(#11047) #11118

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion planner/core/logical_plan_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -3148,7 +3148,7 @@ func (b *PlanBuilder) buildWindowFunctions(p LogicalPlan, groupedFuncs map[*ast.
return nil, nil, err
}
if desc == nil {
return nil, nil, ErrWrongArguments.GenWithStackByArgs(windowFunc.F)
return nil, nil, ErrWrongArguments.GenWithStackByArgs(strings.ToLower(windowFunc.F))
}
preArgs += len(windowFunc.Args)
desc.WrapCastForAggArgs(b.ctx)
Expand Down
4 changes: 4 additions & 0 deletions planner/core/logical_plan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2281,6 +2281,10 @@ func (s *testPlanSuite) TestWindowFunction(c *C) {
sql: "select nth_value(a, 1.0) over() from t",
result: "[planner:1210]Incorrect arguments to nth_value",
},
{
sql: "SELECT NTH_VALUE(a, 1.0) OVER() FROM t",
result: "[planner:1210]Incorrect arguments to nth_value",
},
{
sql: "select nth_value(a, 0) over() from t",
result: "[planner:1210]Incorrect arguments to nth_value",
Expand Down