Class ChangePoint
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.ChangePoint
- All Implemented Interfaces:
NamedWriteable,Writeable,PostAnalysisVerificationAware,Resolvable,LicenseAware,ExecutesOn,ExecutesOn.Coordinator,SurrogateLogicalPlan
public class ChangePoint
extends UnaryPlan
implements SurrogateLogicalPlan, PostAnalysisVerificationAware, LicenseAware, ExecutesOn.Coordinator
Plan that detects change points in a list of values. See also:
ChangePoint should always run on the coordinating node after the data is collected
in sorted order by key. This is enforced by adding OrderBy in the surrogate plan.
Furthermore, ChangePoint should be called with at most 1000 data points. That's
enforced by the Limit in the surrogate plan.
-
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.xpack.esql.plan.logical.ExecutesOn
ExecutesOn.Coordinator, ExecutesOn.ExecuteLocation, ExecutesOn.RemoteNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Constructor Summary
ConstructorsConstructorDescriptionChangePoint(Source source, LogicalPlan child, Attribute value, Attribute key, Attribute targetType, Attribute targetPvalue) -
Method Summary
Modifier and TypeMethodDescriptionprotected AttributeSetThis very likely needs to be overridden forQueryPlan.references()to be correct when inheriting.booleanbooleaninthashCode()protected NodeInfo<ChangePoint> info()key()booleanlicenseCheck(XPackLicenseState state) Return true if the implementer can be executed under the providedXPackLicenseState, otherwise false.output()The ordered list of attributes (i.e.voidpostAnalysisVerification(Failures failures) Allows the implementer to validate itself.replaceChild(LogicalPlan newChild) Returns the plan to be replaced with.value()voidwriteTo(StreamOutput out) Methods 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, 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, 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, transformUpMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xpack.esql.plan.logical.ExecutesOn.Coordinator
executesOn
-
Constructor Details
-
ChangePoint
-
-
Method Details
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
getWriteableName
- Specified by:
getWriteableNamein interfaceNamedWriteable
-
info
- Specified by:
infoin classNode<LogicalPlan>
-
replaceChild
- Specified by:
replaceChildin classUnaryPlan
-
output
Description copied from class:QueryPlanThe ordered list of attributes (i.e. columns) this plan produces when executed. Must be called only on resolved plans, otherwise may throw an exception or return wrong results. -
value
-
key
-
targetType
-
targetPvalue
-
computeReferences
Description copied from class:QueryPlanThis very likely needs to be overridden forQueryPlan.references()to be correct when inheriting. This can be called on unresolved plans and therefore must not rely on calls toQueryPlan.output().- Overrides:
computeReferencesin classQueryPlan<LogicalPlan>
-
expressionsResolved
public boolean expressionsResolved()- Specified by:
expressionsResolvedin classLogicalPlan
-
hashCode
public int hashCode() -
equals
-
surrogate
Description copied from interface:SurrogateLogicalPlanReturns the plan to be replaced with.- Specified by:
surrogatein interfaceSurrogateLogicalPlan
-
postAnalysisVerification
Description copied from interface:PostAnalysisVerificationAwareAllows the implementer to validate itself. This usually involves checking its internal setup, which often means checking the parameters it received on construction: their data or syntactic type, class, their count, expressions' structure etc. The discovered failures are added to the givenFailuresobject.It is often more useful to perform the checks as extended as it makes sense, over stopping at the first failure. This will allow the author to progress faster to a correct query.
Example: the
Filterclass, which models the WHERE command, checks that the expression it filters on -condition- is of a Boolean or NULL type:@Override void postAnalysisVerification(Failures failures) { if (condition.dataType() != NULL && condition.dataType() != BOOLEAN) { failures.add(fail(condition, "Condition expression needs to be boolean, found [{}]", condition.dataType())); } }- Specified by:
postAnalysisVerificationin interfacePostAnalysisVerificationAware- Parameters:
failures- the object to add failures to.
-
licenseCheck
Description copied from interface:LicenseAwareReturn true if the implementer can be executed under the providedXPackLicenseState, otherwise false.- Specified by:
licenseCheckin interfaceLicenseAware
-