-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
executor: copy row data instead of refereeing chunk.Row in some window functions. #11678
Conversation
Did you reference a wrong PR number? @SunRunAway |
@foreyes sorry, fixed. |
Codecov Report
@@ Coverage Diff @@
## master #11678 +/- ##
===========================================
Coverage ? 81.4533%
===========================================
Files ? 432
Lines ? 93192
Branches ? 0
===========================================
Hits ? 75908
Misses ? 11866
Partials ? 5418 |
a751e19
to
71e9ca9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
71e9ca9
to
c4c83a0
Compare
2410a7a
to
0c430ed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
cherry pick to release-3.0 in PR #11823 |
What problem does this PR solve?
Fixes #11614, and fixes #11626 .
If a
chunk.Chunk
reuse into a window function executor, it may break the internal memory reference in functionRANK
orPERCENT_RANK
.chk := NewChunk()
windowExecutor.Next(chk)
windowExecutor
put column results intochk
while refereeing thechunk.Row
intoPartialResult
of functionRANK
orPERCENT_RANK
.windowExecutor.Next(chk)
again to collect next batch of result and reuses the samechk
.chunk.Row
refereced byPartialResult
is broken whenchk.Reset
is called.What is changed and how it works?
Change step 3 above, copy row data instead of refereeing chunk.Row in window functions which rely on data comparing.
Check List
Tests
Code changes
Side effects
lag
because it cannot be finished with old code.Related changes