Class PromqlCommand
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.PromqlCommand
- All Implemented Interfaces:
NamedWriteable,Writeable,PostAnalysisVerificationAware,TelemetryAware,Resolvable,TimestampAware
public class PromqlCommand
extends UnaryPlan
implements TelemetryAware, PostAnalysisVerificationAware, TimestampAware
Container plan for embedded PromQL queries.
Gets eliminated by the analyzer once the query is validated.
-
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
ConstructorsConstructorDescriptionPromqlCommand(Source source, LogicalPlan child, LogicalPlan promqlPlan, Literal start, Literal end, Literal step, String valueColumnName, Expression timestamp) PromqlCommand(Source source, LogicalPlan child, LogicalPlan promqlPlan, Literal start, Literal end, Literal step, String valueColumnName, NameId valueId, NameId stepId, Expression timestamp) -
Method Summary
Modifier and TypeMethodDescriptionend()booleanbooleaninthashCode()protected NodeInfo<PromqlCommand> info()booleanbooleanoutput()The ordered list of attributes (i.e.voidpostAnalysisVerification(Failures failures) Allows the implementer to validate itself.replaceChild(LogicalPlan newChild) start()step()stepId()valueId()withPromqlPlan(LogicalPlan newPromqlPlan) 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, 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, propertiesToString, replaceChildrenSameSize, source, sourceLocation, sourceText, toString, transformChildren, transformDown, transformDown, transformDown, transformNodeProps, transformPropertiesDown, transformPropertiesOnly, transformPropertiesUp, transformUp, transformUp, transformUp
-
Constructor Details
-
PromqlCommand
public PromqlCommand(Source source, LogicalPlan child, LogicalPlan promqlPlan, Literal start, Literal end, Literal step, String valueColumnName, Expression timestamp) -
PromqlCommand
public PromqlCommand(Source source, LogicalPlan child, LogicalPlan promqlPlan, Literal start, Literal end, Literal step, String valueColumnName, NameId valueId, NameId stepId, Expression timestamp)
-
-
Method Details
-
info
- Specified by:
infoin classNode<LogicalPlan>
-
replaceChild
- Specified by:
replaceChildin classUnaryPlan
-
withPromqlPlan
-
expressionsResolved
public boolean expressionsResolved()- Specified by:
expressionsResolvedin classLogicalPlan
-
telemetryLabel
- Specified by:
telemetryLabelin interfaceTelemetryAware- Returns:
- the label reported in the telemetry data. Only needs to be overwritten if the label doesn't match the class name.
-
getWriteableName
- Specified by:
getWriteableNamein interfaceNamedWriteable
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
promqlPlan
-
start
-
end
-
step
-
isInstantQuery
public boolean isInstantQuery() -
isRangeQuery
public boolean isRangeQuery() -
valueColumnName
-
valueId
-
stepId
-
timestamp
- Specified by:
timestampin interfaceTimestampAware
-
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. -
hashCode
public int hashCode() -
equals
-
nodeString
- Overrides:
nodeStringin classNode<LogicalPlan>
-
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.
-