Class WithinSeriesAggregate
java.lang.Object
org.elasticsearch.xpack.esql.core.tree.Node<LogicalPlan>
org.elasticsearch.xpack.esql.plan.QueryPlan<LogicalPlan>
org.elasticsearch.xpack.esql.plan.logical.LogicalPlan
org.elasticsearch.xpack.esql.plan.logical.UnaryPlan
org.elasticsearch.xpack.esql.plan.logical.promql.PromqlFunctionCall
org.elasticsearch.xpack.esql.plan.logical.promql.WithinSeriesAggregate
- All Implemented Interfaces:
NamedWriteable,Writeable,Resolvable
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))
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.xpack.esql.plan.logical.LogicalPlan
LogicalPlan.StageNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields inherited from class org.elasticsearch.xpack.esql.core.tree.Node
TO_STRING_MAX_WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionWithinSeriesAggregate(Source source, LogicalPlan child, String functionName, List<Expression> parameters) -
Method Summary
Modifier and TypeMethodDescriptionprotected NodeInfo<PromqlFunctionCall> info()Normally, you want to use one of the staticcreatemethods to implement this.replaceChild(LogicalPlan newChild) Methods inherited from class org.elasticsearch.xpack.esql.plan.logical.promql.PromqlFunctionCall
equals, expressionsResolved, functionName, getWriteableName, hashCode, output, parameters, writeToMethods inherited from class org.elasticsearch.xpack.esql.plan.logical.UnaryPlan
child, inputSet, outputSet, replaceChildrenMethods inherited from class org.elasticsearch.xpack.esql.plan.logical.LogicalPlan
analyzed, childrenResolved, optimized, preAnalyzed, preOptimized, resolved, setAnalyzed, setOptimized, setPreAnalyzed, setPreOptimizedMethods inherited from class org.elasticsearch.xpack.esql.plan.QueryPlan
computeExpressions, computeReferences, expressions, forEachExpression, forEachExpression, forEachExpressionDown, forEachExpressionUp, references, transformExpressionsDown, transformExpressionsDown, transformExpressionsOnly, transformExpressionsOnly, transformExpressionsOnlyUp, transformExpressionsUp, transformExpressionsUpMethods inherited from class org.elasticsearch.xpack.esql.core.tree.Node
anyMatch, children, collect, collect, collect, collectFirstChildren, collectLeaves, doCollectFirst, forEachDown, forEachDown, forEachDownMayReturnEarly, forEachProperty, forEachPropertyDown, forEachPropertyOnly, forEachPropertyUp, forEachUp, forEachUp, nodeName, nodeProperties, nodeString, propertiesToString, replaceChildrenSameSize, source, sourceLocation, sourceText, toString, transformChildren, transformDown, transformDown, transformDown, transformNodeProps, transformPropertiesDown, transformPropertiesOnly, transformPropertiesUp, transformUp, transformUp, transformUp
-
Constructor Details
-
WithinSeriesAggregate
public WithinSeriesAggregate(Source source, LogicalPlan child, String functionName, List<Expression> parameters)
-
-
Method Details
-
info
Description copied from class:NodeNormally, you want to use one of the staticcreatemethods 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 likeQueryPlan#transformExpressionsOnly(Function)will not have an effect.- Overrides:
infoin classPromqlFunctionCall
-
replaceChild
- Overrides:
replaceChildin classPromqlFunctionCall
-