Skip to content

Conversation

@dnhatn
Copy link
Member

@dnhatn dnhatn commented Feb 28, 2025

This change adds support for skipping shards with event.ingested fields and metadata fields (_tier, _index). This should allow ES|QL to skip unmatched shards and avoid sending requests to the data nodes.

@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Feb 28, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@dnhatn dnhatn requested review from astefan, idegtiarenko, luigidellaquila and nik9000 and removed request for idegtiarenko and nik9000 February 28, 2025 16:24
elasticsearchmachine and others added 2 commits February 28, 2025 08:29

public static QueryBuilder canMatchFilter(PhysicalPlan plan) {
// metadata field like _index, _tier
return detectFilter(plan, f -> CAN_MATCH_FIELDS.contains(f) || f.startsWith("_"));
Copy link
Member

Choose a reason for hiding this comment

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

this might pull in other fields starting with _ , such as _score or other user defined functions.

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. To what degree the filter inside can match though be generified?

@dnhatn
Copy link
Member Author

dnhatn commented Feb 28, 2025

Thanks Costin. I've updated the list of supported field names in 89b5ad9.

@dnhatn dnhatn added the auto-backport Automatically create backport pull requests when merged label Feb 28, 2025
@dnhatn dnhatn merged commit cdd4df5 into elastic:main Mar 1, 2025
17 checks passed
@dnhatn dnhatn deleted the more-can-match branch March 1, 2025 01:45
dnhatn added a commit to dnhatn/elasticsearch that referenced this pull request Mar 1, 2025
This change adds support for skipping shards with event.ingested fields 
and metadata fields (_tier, _index). This should allow ES|QL to skip
unmatched shards and avoid sending requests to the data nodes.
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
9.0 Commit could not be cherrypicked due to conflicts
8.18 Commit could not be cherrypicked due to conflicts
8.x

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 123728

elasticsearchmachine pushed a commit that referenced this pull request Mar 1, 2025
This change adds support for skipping shards with event.ingested fields 
and metadata fields (_tier, _index). This should allow ES|QL to skip
unmatched shards and avoid sending requests to the data nodes.
dnhatn added a commit to dnhatn/elasticsearch that referenced this pull request Mar 3, 2025
This change adds support for skipping shards with event.ingested fields
and metadata fields (_tier, _index). This should allow ES|QL to skip
unmatched shards and avoid sending requests to the data nodes.

(cherry picked from commit cdd4df5)
dnhatn added a commit that referenced this pull request Mar 3, 2025
This change adds support for skipping shards with event.ingested fields
and metadata fields (_tier, _index). This should allow ES|QL to skip
unmatched shards and avoid sending requests to the data nodes.

(cherry picked from commit cdd4df5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL auto-backport Automatically create backport pull requests when merged >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.18.0 v8.19.0 v9.0.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants