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

cql3: selection: fix GROUP BY, empty groups, and aggregations #14399

Closed
wants to merge 1 commit into from

Conversation

avikivity
Copy link
Member

A GROUP BY combined with aggregation should produce a single row per group, except for empty groups. This is in contrast to an aggregation without GROUP BY, which produces a single row no matter what.

The existing code only considered the case of no grouping and forced a row into the result, but this caused an unwanted row if grouping was used.

Fix by refining the check to also consider GROUP BY.

XFAIL tests are relaxed.

Fixes #12477.

Note, forward_service requires that aggregation produce exactly one row, but since it can't work with grouping, it isn't affected.

A GROUP BY combined with aggregation should produce a single
row per group, except for empty groups. This is in contrast
to an aggregation without GROUP BY, which produces a single
row no matter what.

The existing code only considered the case of no grouping
and forced a row into the result, but this caused an unwanted
row if grouping was used.

Fix by refining the check to also consider GROUP BY.

XFAIL tests are relaxed.

Fixes scylladb#12477.

Note, forward_service requires that aggregation produce
exactly one row, but since it can't work with grouping,
it isn't affected.
@avikivity avikivity requested a review from nyh as a code owner June 26, 2023 18:33
@scylladb-promoter
Copy link
Contributor

@nyh
Copy link
Contributor

nyh commented Jun 27, 2023

CI failed (timeout on debug-mode Alternator test), I couldn't find any logs :-( Restarting it.

@scylladb-promoter
Copy link
Contributor

@avikivity
Copy link
Member Author

@nyh ping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Combination of COUNT with GROUP BY is different from Cassandra in case of no matches
3 participants