Frame window function - #2566
Merged
Merged
Conversation
- frame value objects: ROWS, peer and whole-partition, built by DSL bounds - SQL-compliant default frame, peer-aware when ordered (BC break) - WindowFunction::apply() takes a WindowContext with a lazily sliced frame - count() over a window means SQL COUNT, not rows sharing a value - partitionBy() no longer overwrites orderBy(); row_number() fixed on duplicate rows - sort each partition once and hoist loop invariants out of aggregate paths - replace expectation-less mocks with stubs across test suites
- add FrameAccumulating contract, aggregate growing frames incrementally - add PartitionRanking contract, rank in one pass per partition - fix rank/dense_rank ignoring ORDER BY direction - support multiple ORDER BY columns in rank/dense_rank - resolve entry reference once in Entries::find() - narrow WindowFunction::over() return type to static
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 1.x #2566 +/- ##
============================================
+ Coverage 86.43% 86.50% +0.07%
- Complexity 23303 23569 +266
============================================
Files 1803 1812 +9
Lines 71434 71546 +112
============================================
+ Hits 61747 61894 +147
+ Misses 9687 9652 -35 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves: #1974
Change Log
Added
flow-php/etl- window frames viarowsBetween()withunbounded_preceding(),preceding(),current_row(),following()andunbounded_following()flow-php/etl-count()over a window without a reference counts every row in the frameflow-php/etl-rank()anddense_rank()accept multipleorderBy()columnsflow-php/etl-FrameAccumulatingandPartitionRankingcontracts for incremental window evaluationFixed
flow-php/etl-rank()anddense_rank()ignored theorderBy()directionflow-php/etl-row_number()gave duplicated rows the same numberChanged
flow-php/etl- window aggregates over an ordered window use the SQL default frame instead of the whole partitionflow-php/etl-count()over a window counts non-null values in the frameflow-php/etl-partitionBy()no longer setsorderBy()flow-php/etl-WindowFunction::apply()receives aWindowContextflow-php/etl-WindowFunction::over()returnsstaticflow-php/etl- window functions evaluate once per partition instead of once per row, up to 29x fasterRemoved
Deprecated
Security