yugabyte/yugabyte-db

YCQL -- Disallow GROUP BY syntax

Open

#13.956 aperta il 9 set 2022

Vedi su GitHub
 (2 commenti) (0 reazioni) (1 assegnatario)C (1003 fork)batch import
area/ycqlgood first issuejira-originatedkind/enhancementpriority/high

Metriche repository

Star
 (8229 star)
Metriche merge PR
 (Merge medio 17g 21h) (92 PR mergiate in 30 g)

Descrizione

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.

Guida contributor