Skip to content

Support enrich remote mode #104993

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 5 commits into from
Feb 2, 2024
Merged

Support enrich remote mode #104993

merged 5 commits into from
Feb 2, 2024

Conversation

dnhatn
Copy link
Member

@dnhatn dnhatn commented Jan 31, 2024

This PR supports enrich in remote mode. Enrich with remote mode can't be after another enrich with the coordinator mode, an aggregation, or a limit. While we can't address the first two limitations, we should remove the constraint with LIMIT. Otherwise, users are forced to write queries that may not perform well. For instance,

FROM test
| ORDER @timestamp 
| LIMIT 10 | ENRICH[ccq.mode:remote] 

does not work. In such cases, users must rewrite it as

FROM test 
| ENRICH[ccq.mode:remote]
| ORDER @timestamp 
| LIMIT 10

which is equivalent to bringing all data to the coordinating cluster.

We might consider implementing the actual remote enrich on the coordinating cluster (like remote field extracting), however, this requires retaining the originating cluster and restructing pages for routing, which might be complicated.

@elasticsearchmachine
Copy link
Collaborator

Hi @dnhatn, I've created a changelog YAML for you.

@dnhatn dnhatn requested review from astefan, costin and nik9000 February 1, 2024 06:48
* Ensure that no remote enrich is allowed after a reduction or an enrich with coordinator mode.
* <p>
* TODO:
* For Limit and TopN, we can insert the same node after the remote enrich (also needs to move projections around)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will work on a follow-up for this.

@dnhatn dnhatn marked this pull request as ready for review February 1, 2024 06:50
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Feb 1, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

Copy link
Member

@costin costin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - Thanks Nhat for adding an extensive set of tests!


public class EnrichHelper {

static String randomEnrichCommand(EnrichPolicy policy, String name, Enrich.Mode mode) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is better suited for org.elasticsearch.xpack.esql.EsqlTestUtils.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++ I've moved it to 6027453

@dnhatn
Copy link
Member Author

dnhatn commented Feb 2, 2024

Thanks, Costin!

@dnhatn dnhatn merged commit 77309db into elastic:main Feb 2, 2024
@dnhatn dnhatn deleted the enrich-remote branch February 2, 2024 06:03
@dnhatn
Copy link
Member Author

dnhatn commented Feb 3, 2024

Please see #105095 for the follow-up work related to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants