Class ForkApproximation

java.lang.Object
org.elasticsearch.xpack.esql.approximation.ForkApproximation
All Implemented Interfaces:
ApproximationDriver

public final class ForkApproximation extends Object implements ApproximationDriver
Approximation for a query that contains FORK and STATS in one or more branches.

The approximation process is similar to Approximation, and makes heavy use of that:

  • The source count is obtained by executing the source count plan of any the branches.
  • If needed, the (filtered) counts are obtained by creating a FORK query containing the branches' count subplans.
Each branch gets its individual sample probability.