Skip to content

Conversation

alex-spies
Copy link
Contributor

@alex-spies alex-spies commented Oct 13, 2025

Relates #131108

Make the minimum transport version available during query planning, so queries can be planned differently if older nodes (or remote clusters) are to take part in the query execution.

More specifically, plug the minimum transport version into:

  • AnalyzerContext
  • LogicalPlanPreOptimizer
  • LogicalPlanOptimizerContext
  • PreMapper
  • PhysicalPlanOptimizerContext
  • Mapper

This means that the whole pipeline from analyzer via logical optimizer and friends until the physical optimizer, which produces the final physical plan, are now aware of the minimum transport version available in this and remote clusters (which participate in the query).

Also, make the tests use a random compatible transport version per default (but ensure the version is consistent across the analysis-optimization pipeline).
This should keep us on our toes for when query plans diverge on newer versions - this will normally require one test for the current transport version and another one for the previous versions.

@alex-spies alex-spies added >non-issue auto-backport Automatically create backport pull requests when merged :Analytics/ES|QL AKA ESQL v9.2.1 v9.3.0 labels Oct 13, 2025
@alex-spies alex-spies marked this pull request as ready for review October 14, 2025 17:18
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Oct 14, 2025
@elasticsearchmachine
Copy link
Collaborator

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

/**
* Values for cluster level settings used during query analysis.
*/
public record AnalyzerSettings(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mostly unrelated cleanup: This got renamed from EsqlQueryClusterSettings because these are only relevant for the analyzer. Also aligned with our PlannerSettings.java.


private static final TransportVersion ESQL_FIELD_ATTRIBUTE_DROP_TYPE = TransportVersion.fromName("esql_field_attribute_drop_type");
// Only public for testing
public static final TransportVersion ESQL_FIELD_ATTRIBUTE_DROP_TYPE = TransportVersion.fromName("esql_field_attribute_drop_type");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just needed one public transport version that's not pre-8.17 :D

@alex-spies alex-spies requested review from ivancea and nik9000 October 14, 2025 17:36
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 >non-issue Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v9.2.1 v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants