Class MvAvg
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.core.expression.function.scalar.ScalarFunction
org.elasticsearch.xpack.esql.expression.function.scalar.EsqlScalarFunction
org.elasticsearch.xpack.esql.expression.function.scalar.UnaryScalarFunction
org.elasticsearch.xpack.esql.expression.function.scalar.multivalue.AbstractMultivalueFunction
org.elasticsearch.xpack.esql.expression.function.scalar.multivalue.MvAvg
- All Implemented Interfaces:
NamedWriteable,Writeable,Resolvable,EvaluatorMapper
Reduce a multivalued field to a single valued field containing the average value.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.xpack.esql.expression.function.scalar.multivalue.AbstractMultivalueFunction
AbstractMultivalueFunction.AbstractEvaluator, AbstractMultivalueFunction.AbstractNullableEvaluatorNested classes/interfaces inherited from class org.elasticsearch.xpack.esql.core.expression.Expression
Expression.TypeResolutionNested classes/interfaces inherited from interface org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper
EvaluatorMapper.ToEvaluatorNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsFields inherited from class org.elasticsearch.xpack.esql.expression.function.scalar.UnaryScalarFunction
fieldFields inherited from class org.elasticsearch.xpack.esql.core.expression.function.scalar.ScalarFunction
MAX_BYTES_REF_RESULT_SIZEFields inherited from class org.elasticsearch.xpack.esql.core.tree.Node
TO_STRING_MAX_WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondataType()TheDataTypereturned by executing the tree rooted at this expression.protected EvalOperator.ExpressionEvaluator.FactoryBuild the evaluator given the evaluator a multivalued field.static doublefinish(CompensatedSum sum, int valueCount) protected NodeInfo<? extends Expression> info()Normally, you want to use one of the staticcreatemethods to implement this.static voidprocess(CompensatedSum sum, double v) replaceChildren(List<Expression> newChildren) protected Expression.TypeResolutionMethods inherited from class org.elasticsearch.xpack.esql.expression.function.scalar.multivalue.AbstractMultivalueFunction
resolveType, toEvaluator, writeToMethods inherited from class org.elasticsearch.xpack.esql.expression.function.scalar.UnaryScalarFunction
field, foldableMethods inherited from class org.elasticsearch.xpack.esql.expression.function.scalar.EsqlScalarFunction
foldMethods inherited from class org.elasticsearch.xpack.esql.core.expression.function.Function
arguments, equals, functionName, hashCode, nodeString, nullableMethods inherited from class org.elasticsearch.xpack.esql.core.expression.Expression
canonical, canonicalize, childrenResolved, propertiesToString, references, resolved, semanticEquals, semanticHash, toString, typeResolvedMethods 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, replaceChildrenSameSize, source, sourceLocation, sourceText, transformChildren, transformDown, transformDown, transformDown, transformNodeProps, transformPropertiesDown, transformPropertiesOnly, transformPropertiesUp, transformUp, transformUp, transformUpMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper
fold
-
Field Details
-
ENTRY
-
-
Constructor Details
-
MvAvg
-
-
Method Details
-
getWriteableName
-
resolveFieldType
- Specified by:
resolveFieldTypein classAbstractMultivalueFunction
-
dataType
Description copied from class:ExpressionTheDataTypereturned by executing the tree rooted at this expression. IfExpression.typeResolved()returns an error then the behavior of this method is undefined. It may return a valid type. Or it may throw an exception. Or it may return a totally nonsensical type.- Overrides:
dataTypein classUnaryScalarFunction
-
evaluator
protected EvalOperator.ExpressionEvaluator.Factory evaluator(EvalOperator.ExpressionEvaluator.Factory fieldEval) Description copied from class:AbstractMultivalueFunctionBuild the evaluator given the evaluator a multivalued field.- Specified by:
evaluatorin classAbstractMultivalueFunction
-
replaceChildren
- Specified by:
replaceChildrenin classNode<Expression>
-
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.- Specified by:
infoin classNode<Expression>
-
process
-
finish
-