Class ApproximationVerifier

java.lang.Object
org.elasticsearch.xpack.esql.approximation.ApproximationVerifier

public class ApproximationVerifier extends Object
This class approximate results for certain classes of ES|QL queries. Approximate results are usually much faster to compute than exact results.

A query is currently suitable for approximation if:

  • it has a supported STATS layout: without FORK, exactly one STATS; with FORK, either FROM | FORK (...) | STATS (one STATS after the fork, none inside branches) or FROM | STATS | FORK (...) (exactly one STATS per branch)
  • the other processing commands are from the supported set (SUPPORTED_COMMANDS)
  • the aggregate functions are from the supported set (SUPPORTED_SINGLE_VALUED_AGGS and SUPPORTED_MULTIVALUED_AGGS)
Some of these restrictions may be lifted in the future.
  • Constructor Details

    • ApproximationVerifier

      public ApproximationVerifier()
  • Method Details

    • verifyPlan

      public static ApproximationVerifier.QueryProperties verifyPlan(LogicalPlan logicalPlan, TransportVersion minimumVersion)
      Verifies that a plan is suitable for approximation.
      Returns:
      the query properties relevant for approximation if it's suitable, or null otherwise Adds warning headers as a side effect when the plan is not suitable