opt: when grouping RBR table by primary key, non-grouping columns must be in aggregate functions #99444
Labels
A-multiregion
Related to multi-region
A-sql-optimizer
SQL logical planning and optimizations.
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
O-qa
T-sql-queries
SQL Queries Team
When grouping a table by its primary key, we usually allow non-grouping columns in the SELECT clause without aggregation functions (because there is only a single row per group).
(The following uses
cockroach demo --global --nodes 9 --multitenant=false --insecure
.)This is still true when the table has
LOCALITY REGIONAL BY TABLE
:But if we change the table to
LOCALITY REGIONAL BY ROW
thenb
is no longer allowed outside of an aggregation function, even if we constrain the query to a single region:The failures:
Jira issue: CRDB-25879
The text was updated successfully, but these errors were encountered: