-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add support for FIRST_VALUE, LAST_VALUE Aggregate Functions #6445
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
Merged
Merged
Changes from all commits
Commits
Show all changes
66 commits
Select commit
Hold shift + click to select a range
7411d6b
Naive test pass
mustafasrepo 87c397d
Add new tests and simplifications
mustafasrepo ebd0e5f
move tests to the .slt file
mustafasrepo ecc5b0d
update requirement
mustafasrepo 7093fa7
update tests
mustafasrepo e377ea9
Add support for partiallyOrdered aggregation sensitive.
mustafasrepo e0ce989
Resolve linter errors
mustafasrepo e3edf7c
Merge branch 'main' into feature/ordering_sensitive_aggregation
mustafasrepo 550416e
update comments
mustafasrepo d72cc8f
minor changes
mustafasrepo 713b56b
Merge branch 'main' into feature/ordering_sensitive_aggregation
mustafasrepo 3dcf079
retract changes in generated
mustafasrepo a817887
update proto files
mustafasrepo 740a605
Simplifications
ozankabak 8209c46
Make types consistent in schema, and data
mustafasrepo d93b187
Update todos
mustafasrepo 5bb8dde
Convert API to vector
mustafasrepo 72985f8
Convert get_finest to handle Vector inputs
mustafasrepo 4ae5c25
simplifications, update comment
mustafasrepo 6fd96da
initial commit, add test
mustafasrepo 0a52150
Merge branch 'main' into feature/ordering_sensitive_aggregation
mustafasrepo 61cc109
Add support for FIRST Aggregate function.
mustafasrepo 682b1f4
Add support for last aggregate
mustafasrepo 670a327
Update cargo.lock
mustafasrepo 4c27b85
Remove distinct, and limit from First and last aggregate.
mustafasrepo e9535bd
Add reverse for First and Last Aggregator
mustafasrepo 2143b72
Update cargo lock
mustafasrepo 10e7811
Merge branch 'feature/ordering_sensitive_aggregation' into feature/fi…
mustafasrepo c59ce9b
Minor code simplifications
ozankabak 90aa195
Update comment
mustafasrepo 9abfe65
Update documents
mustafasrepo 0527c20
Merge branch 'main' into feature/first_last_aggregate
mustafasrepo 8456a8d
Merge branch 'apache:main' into feature/ordering_sensitive_aggregation
mustafasrepo a4eced0
Fix projection pushdown bug
mustafasrepo 344e184
fix projection push down failure bug
mustafasrepo 2d1482d
Merge branch 'feature/ordering_sensitive_aggregation' into feature/fi…
mustafasrepo 9d01d4d
combine first_agg and last_agg parsers
mustafasrepo 9be10fb
Merge branch 'main' into feature/first_last_aggregate
mustafasrepo 8fc5b82
Update documentation
mustafasrepo 2ac73d6
Update subproject
mustafasrepo dbe0826
initial commit
mustafasrepo 118fa92
Add test code
mustafasrepo 228d973
initial version
mustafasrepo c9cca16
simplify prints
mustafasrepo 8a87fdb
minor changes
mustafasrepo 1db5683
sqllogictests pass
mustafasrepo 2b2ae1d
All tests pass
mustafasrepo 2804350
update proto function names
mustafasrepo e5a2776
Minor changes
mustafasrepo 0889165
Merge branch 'main' into feature/first_last_aggregate2
mustafasrepo af4d209
do not consider ordering requirement in ordering insensitive aggregators
mustafasrepo eacfaff
Reject aggregate order by for window functions.
mustafasrepo 4ce1038
simplifications
mustafasrepo 148dec2
Merge branch 'main' into feature/first_last_aggregate2
mustafasrepo 1bdda38
Fix cargo lock file
mustafasrepo fab0dcd
Merge branch 'main' into feature/first_last_aggregate2
mustafasrepo 94fe486
Update comment
mustafasrepo 13ee806
Rename aggregator first and last
mustafasrepo 1cd494f
minor change
berkaysynnada f2a0a68
Comment improvements
ozankabak c4a47e2
Remove count from First,Last accumulators
mustafasrepo c20ca75
Merge branch 'main' into feature/first_last_aggregate2
mustafasrepo d140e97
Merge branch 'main' into feature/first_last_aggregate2
mustafasrepo 18935b2
Address reviews
mustafasrepo 48057cc
Remove camel to upper snake util, make aggregate function names explicit
mustafasrepo 5cc149a
update the test
mustafasrepo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -155,11 +155,11 @@ async fn test_fn_approx_median() -> Result<()> { | |
| let expr = approx_median(col("b")); | ||
|
|
||
| let expected = vec![ | ||
| "+----------------------+", | ||
| "| APPROXMEDIAN(test.b) |", | ||
| "+----------------------+", | ||
| "| 10 |", | ||
| "+----------------------+", | ||
| "+-----------------------+", | ||
| "| APPROX_MEDIAN(test.b) |", | ||
| "+-----------------------+", | ||
| "| 10 |", | ||
| "+-----------------------+", | ||
| ]; | ||
|
|
||
| let df = create_test_table().await?; | ||
|
|
@@ -175,11 +175,11 @@ async fn test_fn_approx_percentile_cont() -> Result<()> { | |
| let expr = approx_percentile_cont(col("b"), lit(0.5)); | ||
|
|
||
| let expected = vec![ | ||
| "+-------------------------------------------+", | ||
| "| APPROXPERCENTILECONT(test.b,Float64(0.5)) |", | ||
| "+-------------------------------------------+", | ||
| "| 10 |", | ||
| "+-------------------------------------------+", | ||
| "+---------------------------------------------+", | ||
|
Contributor
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. I think this is nice -- it makes the aggregates consistent with the (very) recent change from @2010YOUY01 for scalar functions: #6448 |
||
| "| APPROX_PERCENTILE_CONT(test.b,Float64(0.5)) |", | ||
| "+---------------------------------------------+", | ||
| "| 10 |", | ||
| "+---------------------------------------------+", | ||
| ]; | ||
|
|
||
| let df = create_test_table().await?; | ||
|
|
||
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
As part of this PR, I have added
convert_camel_to_upper_snakeutil for displaying Aggregate functions. Their display name is automatically, calculated from struct name. Hence display name of some of the existing aggregators is changed(such asAPPROXMEDIANbecameAPPROX_MEDIAN,ARRAYAGGbecameARRAY_AGG, etc).