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

colexec: call SetLength on output batches for window functions #66398

Merged
merged 1 commit into from
Jun 12, 2021

Conversation

DrewKimball
Copy link
Collaborator

@DrewKimball DrewKimball commented Jun 12, 2021

Previously, bufferedWindowOp would return batches immediately
after their output columns were entirely filled. However, this caused
the non-decreasing invariant to be violated for bytes output columns
when there were trailing nulls.

This patch modifies bufferedWindowOp to call SetLength on each
batch before it is returned. This ensures that the bytes invariant is
maintained when there are trailing nulls.

See #64793

Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@DrewKimball DrewKimball requested review from yuzefovich and a team June 12, 2021 00:22
Copy link
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

:lgtm:

nit: no need for a release note since there hasn't been a stable release with this bug.

Reviewed 2 of 2 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @DrewKimball)

@DrewKimball
Copy link
Collaborator Author

TFTR!

Previously, `bufferedWindowOp` would return batches immediately
after their output columns were entirely filled. However, this caused
the non-decreasing invariant to be violated for bytes output columns
when there were trailing nulls.

This patch modifies `bufferedWindowOp` to call `SetLength` on each
batch before it is returned. This ensures that the bytes invariant is
maintained when there are trailing nulls.

See cockroachdb#64793

Release note: None
@DrewKimball
Copy link
Collaborator Author

bors r+

@craig
Copy link
Contributor

craig bot commented Jun 12, 2021

Build succeeded:

@craig craig bot merged commit 9335ade into cockroachdb:master Jun 12, 2021
@DrewKimball DrewKimball deleted the window_fix branch June 12, 2021 08:27
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