-
Notifications
You must be signed in to change notification settings - Fork 319
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
feat: support exclude current_row
#2053
feat: support exclude current_row
#2053
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2053 +/- ##
============================================
+ Coverage 75.67% 75.71% +0.03%
Complexity 347 347
============================================
Files 615 615
Lines 116901 117026 +125
Branches 1015 1025 +10
============================================
+ Hits 88463 88602 +139
+ Misses 28229 28215 -14
Partials 209 209
Continue to review full report at Codecov.
|
when `EXCLUDE CURRENT_ROW` set, only specific window results different execute logic: - ROWS_RANGE window where end frame bound is `0s` or `current row` for others: - ROWS window where end frame bound is `0 or CURRENT ROW`: just same as `0 OPEN PRECEDING` - do not apply to `lag/lead/at` function. - do not matter if window is pure history (window bound already excluded current row) This is a basic support, need more tests
RequestUnionRunner should always include the current row
with combination of: 1. maxsize 2. open preceding bound
sql_node_test & planner_v2_test
- codegen a InnerRowsRangeList for Rows_ragnge exclude current_row window in (batch-)request mode. - redesign the nodes supporting `exclude_current_row`
68ed6d8
to
c9c7d48
Compare
TODO:
|
note interface of `WindowInterface` is changed
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
close #1387
Here's the overviews
window ( ROWS_RANGE .. [ 0s preceding | current row ] exclude current_row)
-> special handlingwindow (ROWS .. [ 0 preceding | current row ] exclude current_row)
->window (ROWS .. 0 open preceding)
lag over ( .. exclude current_row)
-> no effectnew field
exclude_current_row_
added to those nodesFrameNode
-> set only by physical transformerWindowDefNode
-> set by plannerWindowPlanNode
PhysicalWindowAggrerationNode
PhysicalRequestUnionNode
WindowAggRunner
batch modeRequestUnionNode
(batch-)request modeInnerRowsRangeList
-> for (batch-)request mode, construct theInnerRowsRangeList(1, rows_end)
forrows_range ( .. os preceding exclude current_row)
HistoryWindow
table handler for batch mode.