-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[ESQL] Plug TopN agg groupings filtering into the language #130111
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
Draft
ivancea
wants to merge
95
commits into
elastic:main
Choose a base branch
from
ivancea:esql-top-n-agg-ql
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 83 commits
Commits
Show all changes
95 commits
Select commit
Hold shift + click to select a range
3322f34
Add initial blockhash with TreeSet and basic operator test
ivancea fcdfbd4
Fix dedupe for nulls and multivalues
ivancea 7282e98
Added tests for null order and sort order
ivancea b6d7265
Merge branch 'main' into esql-top-n-agg-grouping
ivancea 4950f5f
Move generic BlockHash code to base TestCase
ivancea a425c5d
Initial TopNBlockHash test structure, WIP
ivancea 665ace3
Added TopNBlockHash test without nulls, and fixed bug in ords
ivancea 6616fdf
Fix BlockHashTestCase keys assertion early return not checking all keys
ivancea d838057
Added nulls tests, fixed dedupe lookup nulls handling and nulls error…
ivancea e78fac5
Added multivalue tests and fixed dedupe with multivalues and no matches
ivancea 143d86f
Update docs/changelog/127148.yaml
ivancea fa3a779
[CI] Auto commit changes from spotless
4b212cd
Remove TopNBlockHash abstract class
ivancea 87eb135
Remove unused class
ivancea c9635f9
Merge branch 'main' into esql-top-n-agg-grouping
ivancea 29fa4d1
Fix SeenGroupIds and added extra tests for it
ivancea 7ca3ce3
Included TopNLongBlockHash into BlockHash.ubuild() and GroupSpec logi…
ivancea 13900f6
[CI] Auto commit changes from spotless
c778b3b
Keep the last value in the top while using TreeSet, for performance
ivancea 270eb6b
Merge branch 'main' into esql-top-n-agg-grouping
ivancea 5483dc2
Use LongBucketedSort and LongHash for unique seen values
ivancea 3a775ac
Add field recording amount on values in top structure
ivancea 2dde5c1
Fixed to have both last top value and value count
ivancea a5855c1
Specialize block parameters on AddInput
ivancea 5176663
Call the specific add() methods for eacj block type
ivancea fb670bd
Implement custom add in HashAggregationOperator
ivancea ea433a2
Merge branch 'main' into esql-top-n-agg-grouping-tests
ivancea fd97a8c
Updated new aggs
ivancea ddb6735
Added custom sorted structure
ivancea 3d83784
Improve limit migration logic
ivancea 23195a8
Merge branch 'main' into esql-top-n-agg-grouping-tests
ivancea afff00e
Merge branch 'main' into esql-top-n-agg-grouping
ivancea a54ba97
Spotless
ivancea 20f75c1
Merge branch 'main' into esql-top-n-agg-grouping-tests
ivancea 8d101fb
Remove count var
ivancea c27faa0
Removed lastValue field
ivancea 9cff744
Added LonghHash for early detection of existing values
ivancea 22da89e
Revert "Added LonghHash for early detection of existing values"
ivancea 9c12c35
Merge branch 'main' into esql-top-n-agg-grouping-tests
ivancea 714aed9
Merge branch 'main' into esql-top-n-agg-grouping
ivancea 9d8f749
Merge branch 'esql-top-n-agg-grouping' into esql-top-n-agg-grouping-t…
ivancea ed18e7c
Make operator tests not depend directly on the BlockHash implementation
ivancea 16c88eb
Restore original BucketedSort
ivancea 2b1f868
Improve migration and remove unused BucketedSort test
ivancea f0349f4
Remove fixed TO-DOs
ivancea e7ebd05
Fix potential memory leak on circuit breaker error
ivancea 40b7682
Merge branch 'main' into esql-top-n-agg-grouping
ivancea 76291a6
Renamed topN set and added tests
ivancea dd48d97
Remove unused code from TopNMultivalueDedupeLong
ivancea e63b73a
Fix missing success=true in constructor
ivancea ebcab5f
Merge branch 'main' into esql-top-n-agg-ql
ivancea 3916c28
Initial test with attributes within Aggregate
ivancea ee00361
WIP: TopNAggregate nodes, exec not fully implemented yet
ivancea ab0452b
Revert "WIP: TopNAggregate nodes, exec not fully implemented yet"
ivancea a3db630
Added LognHash to early discard values in set and avoid logn searches
ivancea 531711b
Revert "Added LognHash to early discard values in set and avoid logn …
ivancea 92311cd
Reapply "WIP: TopNAggregate nodes, exec not fully implemented yet"
ivancea 70095cf
Fully implemented TopNAggregate, optimizations and rules to be reviewed
ivancea 54aec22
Added TopNAgg csv tests for count and multiple aggs, which can be pus…
ivancea b2c42e4
Merge branch 'main' into esql-top-n-agg-grouping
ivancea 7446e77
Merge branch 'esql-top-n-agg-grouping' into esql-top-n-agg-ql
ivancea 31a2300
Merge branch 'main' into esql-top-n-agg-ql
ivancea d0677c0
Updated Physicial rules and fixed Spatial rule for time series
ivancea 74e780c
Format
ivancea 187dc92
Update with() methods
ivancea 6cff9fb
Assert no TimeSeriesAggregate is converted, and fix logical optimizer…
ivancea 4ce6465
Merge branch 'main' into esql-top-n-agg-ql
ivancea a2d4638
Replaces missing cases of AggregateExec to AbstractAggregateExec and …
ivancea 3ca55b1
Fixed planner tests and added some extra ones
ivancea cc9fa02
Merge branch 'main' into esql-top-n-agg-ql
ivancea a7edabf
Made TopNAggregate a child of Aggregate
ivancea 56ba38b
Merge branch 'main' into esql-top-n-agg-ql
ivancea 7132241
Added pragma to choose the max limit to use the topN agg enhancement
ivancea 3e41bce
Fix outdated test
ivancea 0eb2510
Merge branch 'main' into esql-top-n-agg-ql
ivancea 375e83d
Fix TimeSeries resolution
ivancea 9661efe
Improved replacement rule assertion
ivancea b31d5c6
Update BytesRef handling
ivancea ae2c213
Update docs/changelog/130111.yaml
ivancea 8031385
Fixed benchmarks
ivancea e490ed2
Fix outdated test
ivancea a32e843
Added docs on BlockHash pragma param
ivancea d27069f
Removed AbstractAggregateExec
ivancea 76099ca
Restore AggregateExec field visibility
ivancea e1a0dd3
Restore AggregateExec method order to simplify review
ivancea 027fd2b
Remove copypasted comment and fix calls after new field visibility
ivancea 3594413
Merge branch 'main' into esql-top-n-agg-ql
ivancea 26676b9
Merge branch 'main' into esql-top-n-agg-ql
ivancea a870426
Merge branch 'main' into esql-top-n-agg-ql
ivancea 69946a7
Merge branch 'main' into esql-top-n-agg-ql
ivancea 64fd705
Added topN stats generative test generator
ivancea adcfe2f
Changed pragma default value to 0, and fully disabled TopNAggs on 0 l…
ivancea e925a98
Fix build
ivancea ccdfc7e
Merge branch 'main' into esql-top-n-agg-ql
ivancea f8fee53
Fix test compilation
ivancea 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
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 |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| pr: 130111 | ||
| summary: Plug TopN agg groupings filtering into the language | ||
| area: ES|QL | ||
| type: enhancement | ||
| issues: [] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -519,7 +519,8 @@ private static class ValuesAggregator implements Releasable { | |
| List.of(new GroupSpec(channelIndex, groupingElementType)), | ||
| driverContext.blockFactory(), | ||
| maxPageSize, | ||
| false | ||
| false, | ||
| 0 // TODO: Should this come from the pragma? | ||
|
||
| ), | ||
| driverContext | ||
| ); | ||
|
|
||
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
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
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.
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.
This is where the pragma is being applied (
maxTopNLimit)