Add support for TopN and aggregation pushdown in Elasticsearch#27251
Open
bvolpato wants to merge 8 commits intotrinodb:masterfrom
Open
Add support for TopN and aggregation pushdown in Elasticsearch#27251bvolpato wants to merge 8 commits intotrinodb:masterfrom
bvolpato wants to merge 8 commits intotrinodb:masterfrom
Conversation
b227561 to
b2472b3
Compare
...elasticsearch/src/main/java/io/trino/plugin/elasticsearch/aggregation/MetricAggregation.java
Outdated
Show resolved
Hide resolved
...elasticsearch/src/main/java/io/trino/plugin/elasticsearch/aggregation/MetricAggregation.java
Outdated
Show resolved
Hide resolved
...o-elasticsearch/src/main/java/io/trino/plugin/elasticsearch/aggregation/TermAggregation.java
Outdated
Show resolved
Hide resolved
...o-elasticsearch/src/main/java/io/trino/plugin/elasticsearch/aggregation/TermAggregation.java
Outdated
Show resolved
Hide resolved
6835e1b to
aa1ab91
Compare
Member
Author
|
CI failure seems to be a flake: |
2a5667c to
e6445de
Compare
e6445de to
c3b0dc3
Compare
|
This pull request has gone a while without any activity. Ask for help on #core-dev on Trino slack. |
|
Closing this pull request, as it has been stale for six weeks. Feel free to re-open at any time. |
Member
Author
|
I'd be interested in taking this forward. Any takers for reviewing? 👀 |
Co-authored-by: Murthy Chelankuri <murthy.chelankuri@hpe.com>
c3b0dc3 to
df792eb
Compare
|
This pull request has gone a while without any activity. Ask for help on #core-dev on Trino slack. |
| .toArray(BlockBuilder[]::new); | ||
| this.queryBuilder = buildSearchQuery(table.constraint().transformKeys(ElasticsearchColumnHandle.class::cast), table.query(), table.regexes()); | ||
|
|
||
| long start = System.nanoTime(); |
Contributor
There was a problem hiding this comment.
do we needs this here, or move this line up?
| if (!newRegexes.containsKey(columnName) && pattern instanceof Slice slice) { | ||
| IndexMetadata metadata = client.getIndexMetadata(handle.index()); | ||
| if (metadata.schema() | ||
| .fields().stream() |
Contributor
|
@Praveen2112 @findepi you might be more familiar with Elasticsearch :) |
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.
Description
This PR adds support for TopN, Limit, and Aggregation pushdown to the Elasticsearch connector, improving query performance by leveraging Elasticsearch's native sorting and aggregation capabilities.
TopN and Limit operations are pushed down to each shard, with Trino merging the results to ensure correct global ordering. Aggregation pushdown supports GROUP BY with COUNT, SUM, AVG, MIN, and MAX functions using Elasticsearch's composite and metric aggregations.
Additional context and related issues
This work was previously contributed by @murthy-chelankuri at #16919 and #23118 and I've rebased/fixed the conflicts and revisited the test cases.
Release notes
( ) This is not user-visible or is docs only, and no release notes are required.
(x) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text: