Class UserAgent
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.CompoundOutputEval<UserAgent>
org.elasticsearch.xpack.esql.plan.logical.UserAgent
- All Implemented Interfaces:
NamedWriteable,Writeable,PostAnalysisVerificationAware,TelemetryAware,Resolvable,GeneratingPlan<CompoundOutputEval<UserAgent>>,Streaming
The logical plan for the
USER_AGENT command.-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.xpack.esql.plan.logical.LogicalPlan
LogicalPlan.StageNested classes/interfaces inherited from class org.elasticsearch.xpack.esql.core.tree.Node
Node.NodeStringFormatNested 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.plan.logical.CompoundOutputEval
inputFields inherited from class org.elasticsearch.xpack.esql.core.tree.Node
TO_STRING_MAX_LINES, TO_STRING_MAX_WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionUserAgent(StreamInput in) UserAgent(Source source, LogicalPlan child, Expression input, List<String> outputFieldNames, List<Attribute> outputFieldAttributes, boolean extractDeviceType, String regexFile) -
Method Summary
Modifier and TypeMethodDescriptionstatic UserAgentcreateInitialInstance(Source source, LogicalPlan child, Expression input, Attribute outputFieldPrefix, boolean extractDeviceType, String regexFile, SequencedMap<String, Class<?>> filteredOutputFields) Creates the initial logical plan instance, computing output attributes from the filtered output fields.createNewInstance(Source source, LogicalPlan child, Expression input, List<String> outputFieldNames, List<Attribute> outputFieldAttributes) Creates a new instance of the specificCompoundOutputEvalsubclass with the provided parameters.booleanprotected NodeInfo<? extends LogicalPlan> info()Normally, you want to use one of the staticcreatemethods to implement this.protected booleaninnerEquals(CompoundOutputEval<?> other) protected intvoidpostAnalysisVerification(Failures failures) Allows the implementer to validate itself.voidwriteTo(StreamOutput out) Methods inherited from class org.elasticsearch.xpack.esql.plan.logical.CompoundOutputEval
computeOutputAttributes, computeReferences, equals, expressionsResolved, generatedAttributes, getInput, hashCode, output, outputFieldNames, replaceChild, withGeneratedNamesMethods 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
allMatch, anyMatch, children, collect, collect, collect, collectFirstChildren, collectLeaves, doCollectFirst, forEachDown, forEachDown, forEachDownMayReturnEarly, forEachProperty, forEachPropertyDown, forEachPropertyOnly, forEachPropertyUp, forEachUp, forEachUp, nodeName, nodeProperties, nodeString, nodeString, propertiesToString, replaceChildrenSameSize, source, sourceLocation, sourceText, toString, toString, transformChildren, transformChildren, transformDown, transformDown, transformDown, transformDown, transformDownSkipBranch, 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.GeneratingPlan
checkNumberOfNewNames
-
Field Details
-
ENTRY
-
-
Constructor Details
-
UserAgent
public UserAgent(Source source, LogicalPlan child, Expression input, List<String> outputFieldNames, List<Attribute> outputFieldAttributes, boolean extractDeviceType, String regexFile) -
UserAgent
- Throws:
IOException
-
-
Method Details
-
createInitialInstance
public static UserAgent createInitialInstance(Source source, LogicalPlan child, Expression input, Attribute outputFieldPrefix, boolean extractDeviceType, String regexFile, SequencedMap<String, Class<?>> filteredOutputFields) Creates the initial logical plan instance, computing output attributes from the filtered output fields. The caller (LogicalPlanBuilder) resolves properties and extractDeviceType into the filtered output fields map. -
writeTo
- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classCompoundOutputEval<UserAgent>- Throws:
IOException
-
createNewInstance
public UserAgent createNewInstance(Source source, LogicalPlan child, Expression input, List<String> outputFieldNames, List<Attribute> outputFieldAttributes) Description copied from class:CompoundOutputEvalCreates a new instance of the specificCompoundOutputEvalsubclass with the provided parameters. Subclasses should call their corresponding constructor with the provided arguments and the concrete evaluator instance.- Specified by:
createNewInstancein classCompoundOutputEval<UserAgent>- Parameters:
source- the source informationchild- the child logical planinput- the input expressionoutputFieldNames- the output field names, used for the computation of the output attributesoutputFieldAttributes- the output attributes- Returns:
- a new instance of the specific
CompoundOutputEvalsubclass
-
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 classCompoundOutputEval<UserAgent>
-
innerHashCode
protected int innerHashCode()- Specified by:
innerHashCodein classCompoundOutputEval<UserAgent>
-
innerEquals
- Specified by:
innerEqualsin classCompoundOutputEval<UserAgent>
-
getWriteableName
-
telemetryLabel
- Returns:
- the label reported in the telemetry data. Only needs to be overwritten if the label doesn't match the class name.
-
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())); } }- Parameters:
failures- the object to add failures to.
-
extractDeviceType
public boolean extractDeviceType() -
regexFile
-