Class WithinSeriesAggregate

All Implemented Interfaces:
NamedWriteable, Writeable, Resolvable

public class WithinSeriesAggregate extends PromqlFunctionCall
Represents a PromQL aggregate function call that operates on range vectors. This is a surrogate logical plan for PromQL range vector functions that translate to ESQL TimeSeriesAggregate operations. It extends PromqlFunctionCall and implements the surrogate pattern to transform PromQL aggregations into ESQL time-series aggregates. Range vector functions supported: - Counter functions: rate(), irate(), increase(), delta(), idelta() - Aggregation functions: avg_over_time(), sum_over_time(), min_over_time(), max_over_time(), count_over_time() - Selection functions: first_over_time(), last_over_time() - Presence functions: present_over_time(), absent_over_time() - Cardinality functions: count_distinct_over_time() During planning, surrogate() transforms this node into: TimeSeriesAggregate( child: RangeSelector (or other time-series source), groupings: [_tsid], aggregates: [function_result, _tsid] ) Example transformations: rate(http_requests[5m]) → TimeSeriesAggregate(groupBy: _tsid, agg: Rate(value, @timestamp)) avg_over_time(cpu_usage[1h]) → TimeSeriesAggregate(groupBy: _tsid, agg: AvgOverTime(value))
  • Constructor Details

  • Method Details

    • info

      protected NodeInfo<PromqlFunctionCall> info()
      Description copied from class: Node
      Normally, you want to use one of the static create methods to implement this.

      For QueryPlans, it is very important that the properties contain all of the expressions and references relevant to this node, and that all the properties are used in the provided constructor; otherwise query plan transformations like QueryPlan#transformExpressionsOnly(Function) will not have an effect.

      Overrides:
      info in class PromqlFunctionCall
    • replaceChild

      public WithinSeriesAggregate replaceChild(LogicalPlan newChild)
      Overrides:
      replaceChild in class PromqlFunctionCall