Class NamedExpression
java.lang.Object
org.elasticsearch.xpack.esql.core.tree.Node<Expression>
org.elasticsearch.xpack.esql.core.expression.Expression
org.elasticsearch.xpack.esql.core.expression.NamedExpression
- All Implemented Interfaces:
NamedWriteable,Writeable,Resolvable
- Direct Known Subclasses:
Alias,Attribute,UnresolvedNamedExpression
An expression that has a name. Named expressions can be used as a result
(by converting to an attribute).
-
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> -
Constructor Summary
ConstructorsConstructorDescriptionNamedExpression(Source source, String name, List<Expression> children, NameId id) NamedExpression(Source source, String name, List<Expression> children, NameId id, boolean synthetic) -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanPolymorphic equality is a pain and are likely slower than a regular ones.inthashCode()id()protected booleanname()booleanSynthetic named expressions are not user defined and usually created during optimizations and substitutions, e.g.abstract AttributetoString()Methods inherited from class org.elasticsearch.xpack.esql.core.expression.Expression
canonical, canonicalize, childrenResolved, dataType, fold, foldable, nullable, propertiesToString, references, resolved, resolveType, semanticEquals, semanticHash, 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, info, nodeName, nodeProperties, replaceChildren, 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.common.io.stream.NamedWriteable
getWriteableName
-
Constructor Details
-
NamedExpression
-
NamedExpression
public NamedExpression(Source source, String name, List<Expression> children, @Nullable NameId id, boolean synthetic)
-
-
Method Details
-
name
-
id
-
synthetic
public boolean synthetic()Synthetic named expressions are not user defined and usually created during optimizations and substitutions, e.g. when turning... | STATS x = avg(2*field)into... | EVAL $$synth$attribute = 2*field | STATS x = avg($$synth$attribute). -
toAttribute
Try to return eitherthisif it is anAttribute, or aReferenceAttributeto it otherwise. Return anUnresolvedAttributeif this is unresolved. -
hashCode
public int hashCode()- Overrides:
hashCodein classNode<Expression>
-
equals
Polymorphic equality is a pain and are likely slower than a regular ones. This equals shortcuts `this == o` and type checks (important when we expect only a few non-equal objects). Here equals is final to ensure we are not duplicating those checks. For actual equality check override `innerEquals` instead.- Overrides:
equalsin classNode<Expression>
-
innerEquals
-
toString
- Overrides:
toStringin classExpression
-
nodeString
- Overrides:
nodeStringin classNode<Expression>
-