Class ToPartial
java.lang.Object
org.elasticsearch.xpack.esql.core.tree.Node<Expression>
org.elasticsearch.xpack.esql.core.expression.Expression
org.elasticsearch.xpack.esql.core.expression.function.Function
org.elasticsearch.xpack.esql.expression.function.aggregate.AggregateFunction
org.elasticsearch.xpack.esql.expression.function.aggregate.ToPartial
- All Implemented Interfaces:
NamedWriteable,Writeable,PostAnalysisPlanVerificationAware,Resolvable,ToAggregator
An internal aggregate function that always emits intermediate (or partial) output regardless
of the aggregate mode. The intermediate output should be consumed by
FromPartial,
which always receives the intermediate input. Since an intermediate aggregate output can
consist of multiple blocks, we wrap these output blocks in a single composite block.
The FromPartial then unwraps this input block into multiple primitive blocks and
passes them to the delegating GroupingAggregatorFunction.
Both of these commands yield the same result, except the second plan executes aggregates twice:
``` | ... before | af(x) BY g | ... after ``` ``` | ... before | $x = to_partial(af(x)) BY g | from_partial($x, af(_)) BY g | ... after```
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.xpack.esql.core.expression.Expression
Expression.TypeResolutionNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionToPartial(Source source, Expression field, Expression function) ToPartial(Source source, Expression field, Expression filter, Expression function) -
Method Summary
Modifier and TypeMethodDescriptiondataType()protected voidfunction()info()replaceChildren(List<Expression> newChildren) protected Expression.TypeResolutionsupplier()withFilter(Expression filter) Attach a filter to the aggregate function.Methods inherited from class org.elasticsearch.xpack.esql.expression.function.aggregate.AggregateFunction
equals, field, filter, hasFilter, hashCode, parameters, postAnalysisPlanVerification, readGenericAggregateFunction, withParameters, writeToMethods inherited from class org.elasticsearch.xpack.esql.core.expression.function.Function
arguments, functionName, nodeString, nullableMethods inherited from class org.elasticsearch.xpack.esql.core.expression.Expression
canonical, canonicalize, childrenResolved, fold, foldable, propertiesToString, references, resolved, semanticEquals, semanticHash, toString, typeResolvedMethods inherited from class org.elasticsearch.xpack.esql.core.tree.Node
anyMatch, children, collect, collectFirstChildren, collectLeaves, doCollectFirst, forEachDown, forEachDown, forEachDownMayReturnEarly, forEachProperty, forEachPropertyDown, forEachPropertyOnly, forEachPropertyUp, forEachUp, forEachUp, nodeName, nodeProperties, replaceChildrenSameSize, source, sourceLocation, sourceText, transformChildren, transformDown, transformDown, transformDown, transformNodeProps, transformPropertiesDown, transformPropertiesOnly, transformPropertiesUp, transformUp, transformUp, transformUp
-
Field Details
-
ENTRY
-
-
Constructor Details
-
ToPartial
-
ToPartial
-
-
Method Details
-
deprecatedWriteParams
- Overrides:
deprecatedWriteParamsin classAggregateFunction- Throws:
IOException
-
getWriteableName
- Specified by:
getWriteableNamein interfaceNamedWriteable
-
function
-
dataType
- Specified by:
dataTypein classExpression
-
resolveType
- Overrides:
resolveTypein classAggregateFunction
-
replaceChildren
- Specified by:
replaceChildrenin classNode<Expression>
-
withFilter
Description copied from class:AggregateFunctionAttach a filter to the aggregate function.- Specified by:
withFilterin classAggregateFunction
-
info
- Specified by:
infoin classNode<Expression>
-
supplier
- Specified by:
supplierin interfaceToAggregator
-