Skip to content

Commit

Permalink
planner: add error message for group_concat (#15345)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaox1n authored Mar 17, 2020
1 parent aec6143 commit 76f63fd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions planner/core/logical_plan_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -3829,6 +3829,9 @@ func (b *PlanBuilder) buildWindowFunctionFrame(ctx context.Context, spec *ast.Wi

func (b *PlanBuilder) checkWindowFuncArgs(ctx context.Context, p LogicalPlan, windowFuncExprs []*ast.WindowFuncExpr, windowAggMap map[*ast.AggregateFuncExpr]int) error {
for _, windowFuncExpr := range windowFuncExprs {
if strings.ToLower(windowFuncExpr.F) == ast.AggFuncGroupConcat {
return ErrNotSupportedYet.GenWithStackByArgs("group_concat as window function")
}
args, err := b.buildArgs4WindowFunc(ctx, p, windowFuncExpr.Args, windowAggMap)
if err != nil {
return err
Expand Down
4 changes: 3 additions & 1 deletion planner/core/testdata/plan_suite_unexported_in.json
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,9 @@
"SELECT SUM(a) OVER w AS 'sum' FROM t WINDOW w AS (ROWS BETWEEN CURRENT ROW AND 1 PRECEDING )",
"SELECT SUM(a) OVER w AS 'sum' FROM t WINDOW w AS (ROWS BETWEEN 1 FOLLOWING AND 1 PRECEDING )",
// Test issue 11943
"SELECT ROW_NUMBER() OVER (partition by b) + a FROM t"
"SELECT ROW_NUMBER() OVER (partition by b) + a FROM t",
// Test issue 10996
"SELECT GROUP_CONCAT(a) OVER () FROM t"
]
},
{
Expand Down
3 changes: 2 additions & 1 deletion planner/core/testdata/plan_suite_unexported_out.json
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@
"[planner:3586]Window 'w': frame start or end is negative, NULL or of non-integral type",
"[planner:3586]Window 'w': frame start or end is negative, NULL or of non-integral type",
"[planner:3586]Window 'w': frame start or end is negative, NULL or of non-integral type",
"TableReader(Table(t))->Sort->Window(row_number()->Column#14 over(partition by test.t.b))->Projection"
"TableReader(Table(t))->Sort->Window(row_number()->Column#14 over(partition by test.t.b))->Projection",
"[planner:1235]This version of TiDB doesn't yet support 'group_concat as window function'"
]
},
{
Expand Down

0 comments on commit 76f63fd

Please sign in to comment.