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

release-22.2: roachtest: make window functions deterministic #105672

Merged
merged 1 commit into from
Jun 28, 2023

Conversation

michae2
Copy link
Collaborator

@michae2 michae2 commented Jun 27, 2023

Backport 1/1 commits from #87591.

/cc @cockroachdb/release


This commit modifies the sqlsmith logic to add all columns to the OVER clause for all window functions except for the ranking functions. This is necessary because all other window/aggregate functions can produce different results for different rows within a peer group. Ordering on all columns ensures that we are ordering on a key, which restricts each peer group to one row (and therefore ensures there is only one possible order within each peer group). This commit also reverts #87426, since window functions should now be deterministic.

Fixes #87353
Fixes #103714

Release note: None


Release justification: test-only change.

This commit modifies the sqlsmith logic to add all columns to the `OVER`
clause for all window functions except for the ranking functions. This is
necessary because all other window/aggregate functions can produce different
results for different rows within a peer group. Ordering on all columns
ensures that we are ordering on a key, which restricts each peer group to
one row (and therefore ensures there is only one possible order within each
peer group). This commit also reverts cockroachdb#87426, since window functions should
now be deterministic.

Fixes cockroachdb#87353

Release note: None
@michae2 michae2 requested a review from a team as a code owner June 27, 2023 23:33
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@michae2 michae2 changed the title roachtest: make window functions deterministic release-22.2: roachtest: make window functions deterministic Jun 27, 2023
Copy link
Collaborator

@DrewKimball DrewKimball left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @mgartner and @yuzefovich)

@michae2 michae2 merged commit 97c27b7 into cockroachdb:release-22.2 Jun 28, 2023
@michae2 michae2 deleted the backport22.2-87591 branch June 28, 2023 16:58
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.

3 participants