-
Notifications
You must be signed in to change notification settings - Fork 3.8k
WindowOperatorQueryFrameProcessor: Avoid unnecessary re-runs of runIncrementally() #17211
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -256,17 +256,19 @@ Most of the window operations like SUM(), RANK(), RANGE() etc. can be made with | |
| } else if (comparePartitionKeys(outputRow, currentRow, partitionColumnNames)) { | ||
| // Add current row to the same batch of rows for processing. | ||
| rowsToProcess.add(currentRow); | ||
| if (rowsToProcess.size() > maxRowsMaterialized) { | ||
| // We don't want to materialize more than maxRowsMaterialized rows at any point in time, so process the pending batch. | ||
| processRowsUpToLastPartition(); | ||
| } | ||
| ensureMaxRowsInAWindowConstraint(rowsToProcess.size()); | ||
| } else { | ||
| lastPartitionIndex = rowsToProcess.size() - 1; | ||
| outputRow = currentRow.copy(); | ||
| return ReturnOrAwait.runAgain(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this return was insane... no wonder it have lead to performance degradation...
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah.. 😅 |
||
| rowsToProcess.add(currentRow); | ||
| } | ||
| frameCursor.advance(); | ||
|
|
||
| if (rowsToProcess.size() > maxRowsMaterialized) { | ||
| // We don't want to materialize more than maxRowsMaterialized rows at any point in time, so process the pending batch. | ||
| processRowsUpToLastPartition(); | ||
| ensureMaxRowsInAWindowConstraint(rowsToProcess.size()); | ||
| return ReturnOrAwait.runAgain(); | ||
| } | ||
|
Comment on lines
+266
to
+271
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. moving this check outside here - will not necessarily enforce that |
||
| } | ||
| return ReturnOrAwait.runAgain(); | ||
| } | ||
|
|
||
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.
this is odd;
outputRowholds a direct reference tocurrentRowat line 254; but here its beingcopy-ed; I think they both should be a copy or neither of them...but again....this will be removed so no big deal