yugabyte/yugabyte-db

YCQL -- Disallow GROUP BY syntax

Open

#13.956 aberto em 9 de set. de 2022

Ver no GitHub
 (2 comments) (0 reactions) (1 assignee)C (1.003 forks)batch import
area/ycqlgood first issuejira-originatedkind/enhancementpriority/high

Métricas do repositório

Stars
 (8.229 stars)
Métricas de merge de PR
 (Mesclagem média 17d 21h) (92 fundiu PRs em 30d)

Description

Jira Link: DB-3446

We don't support the GROUP BY clause in YCQL (only in YSQL) but it is allowed in the syntax (presumably by mistake).

I think the issue is that the group_clause was not disallowed in the parser: https://github.com/yugabyte/yugabyte-db/blob/master/src/yb/yql/cql/ql/parser/parser_gram.y#L2519 (see for instance the PARSER_UNSUPPORTED calls for some of the other sub-cases below -- the should be there for the top-level non-empty case).

In terms of functionality, from this code: https://github.com/yugabyte/yugabyte-db/blob/master/src/yb/yql/cql/ql/parser/parser_gram.y#L2178 it looks like we are just ignoring the GROUP BY clause if set.

Finally, if backwards compatibility is an issue we can make this a warning rather than an error by default (for GROUP BY specifically.

Guia do colaborador