builtins: fix incorrect sqrdiff evaluation due to reuse of the results from previous iterations when used as a window function#55957
Conversation
|
Thank you for contributing to CockroachDB. Please ensure you have followed the guidelines for creating a PR. My owl senses detect your PR is good for review. Please keep an eye out for any test failures in CI. I was unable to automatically find a reviewer. You can try CCing one of the following members:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
|
Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
I was unable to automatically find a reviewer. You can try CCing one of the following members:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
8be3cec to
afc91f7
Compare
|
Thank you for updating your pull request. My owl senses detect your PR is good for review. Please keep an eye out for any test failures in CI. I was unable to automatically find a reviewer. You can try CCing one of the following members:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
|
@yuzefovich could you please take a look? |
yuzefovich
left a comment
There was a problem hiding this comment.
Thanks for finding the bug and fixing it! I only have some nits, but it
Re: ordering: yeah, ORDER BY within OVER() clause doesn't guarantee the ordering of the results, we need to have a query level ORDER BY clause for that.
nit: it'd be nice to include a short description of the bug into the commit message, and we also should add a release note (it'll be something like Release note (bug fix): CockroachDB previously could incorrectly evaluate sqrdiff function when used as a window function in some cases, and now it is fixed.).
Reviewed 3 of 3 files at r1.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @mneverov)
pkg/sql/logictest/testdata/logic_test/aggregate, line 2862 at r1 (raw file):
0.522232967867094 3 # Regression test for window aggregate functions for decimals reuse the results
nit: this test should go into window logic test file.
nit: I'd slightly reword the comment to be a bit more specific - Regression test for window aggregate functions not making a deep copy of decimals on each iteration (#55944).
afc91f7 to
f6eefbe
Compare
|
Thank you for updating your pull request. My owl senses detect your PR is good for review. Please keep an eye out for any test failures in CI. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
mneverov
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @yuzefovich)
pkg/sql/logictest/testdata/logic_test/aggregate, line 2862 at r1 (raw file):
Previously, yuzefovich wrote…
nit: this test should go into
windowlogic test file.nit: I'd slightly reword the comment to be a bit more specific -
Regression test for window aggregate functions not making a deep copy of decimals on each iteration (#55944).
moved to window, replaced the comment, thanks!
|
@yuzefovich thanks for the review. |
yuzefovich
left a comment
There was a problem hiding this comment.
Thanks, one last nit.
Reviewed 2 of 2 files at r2.
Reviewable status:complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @mneverov)
pkg/sql/logictest/testdata/logic_test/window, line 3866 at r2 (raw file):
{"1": "1", "2": "2", "3": "3", "4": "4", "5": "5"} Regression test for window aggregate functions not making a deep copy of decimals on each iteration (#55944)
nit: missing # in the beginning and a period in the end.
…s from previous iterations when used as a window function fixes cockroachdb#55944 Release note (bug fix): CockroachDB previously could incorrectly evaluate sqrdiff function when used as a window function in some cases, and now it is fixed.
f6eefbe to
4bf1804
Compare
mneverov
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @yuzefovich)
pkg/sql/logictest/testdata/logic_test/window, line 3866 at r2 (raw file):
Previously, yuzefovich wrote…
nit: missing
#in the beginning and a period in the end.
fixed thx
yuzefovich
left a comment
There was a problem hiding this comment.
Thanks!
bors r=yuzefovich
Reviewed 1 of 1 files at r3.
Reviewable status:complete! 0 of 0 LGTMs obtained (and 1 stale)
|
Build succeeded: |
builtins: fix incorrect sqrdiff evaluation due to reuse of the results from previous iterations when used as a window function
fixes #55944
Release note (bug fix): CockroachDB previously could incorrectly evaluate sqrdiff function when used as a window function in some cases, and now it is fixed.