Skip to content

[ES|QL] Async implementation of the rule executor. #130741

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
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

afoucret
Copy link
Contributor

@afoucret afoucret commented Jul 7, 2025

Why ?

Currently, the rule executor executor supports only synchronous rules.
This PR is an attempt to add support for asynchronous rules, so we can do async stuffs in the analyzer or logical/physical optimizers.

Changes:

  • Rule is now interface instead of an abstract class
  • Rule is implemented by two different abstract classes Rule.Sync and Rule.Async that can be used to build synchronous or asynchronous rules
  • Existing rules in the analyzer or the optimizers have been migrated to Rule.Sync
  • RuleExecutor::execute now has an async version and its sync version has been marked as deprecated
  • Added unit tests for RuleExecutor.
  • Did the same for ParameterizedRuleExecutor / ParameterizedRule

Performances

./gradlew -p benchmarks run --args QueryPlanningBenchmark                                                                                                                                                                             

Result on main:

Result "org.elasticsearch.benchmark._nightly.esql.QueryPlanningBenchmark.manyFields":
  1.383 ±(99.9%) 0.009 ms/op [Average]
  (min, avg, max) = (1.377, 1.383, 1.396), stdev = 0.006
  CI (99.9%): [1.374, 1.392] (assumes normal distribution)

Benchmark                          Mode  Cnt  Score   Error  Units
QueryPlanningBenchmark.manyFields  avgt   10  1.383 ± 0.009  ms/op

Result on branch:

Result "org.elasticsearch.benchmark._nightly.esql.QueryPlanningBenchmark.manyFields":
  1.264 ±(99.9%) 0.005 ms/op [Average]
  (min, avg, max) = (1.259, 1.264, 1.269), stdev = 0.003
  CI (99.9%): [1.259, 1.269] (assumes normal distribution)

Benchmark                          Mode  Cnt  Score   Error  Units
QueryPlanningBenchmark.manyFields  avgt   10  1.264 ± 0.005  ms/op

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants