Class Literal
java.lang.Object
org.elasticsearch.xpack.esql.core.tree.Node<Expression>
org.elasticsearch.xpack.esql.core.expression.Expression
org.elasticsearch.xpack.esql.core.expression.LeafExpression
org.elasticsearch.xpack.esql.core.expression.Literal
- All Implemented Interfaces:
NamedWriteable,Writeable,Resolvable
Literal or constant.
-
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> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondataType()TheDataTypereturned by executing the tree rooted at this expression.booleanfold(FoldContext ctx) Evaluate this expression statically to a constant.booleanfoldable()Whether the expression can be evaluated statically, aka "folded", or not.inthashCode()info()Return the information about this node.nullable()static Literalof(Expression source, Object value) static Literalof(FoldContext ctx, Expression foldable) Utility method for creating a literal out of a foldable expression.booleanresolved()toString()value()voidwriteTo(StreamOutput out) Methods inherited from class org.elasticsearch.xpack.esql.core.expression.LeafExpression
canonicalize, references, replaceChildrenMethods inherited from class org.elasticsearch.xpack.esql.core.expression.Expression
canonical, childrenResolved, propertiesToString, resolveType, semanticEquals, semanticHash, typeResolvedMethods inherited from class org.elasticsearch.xpack.esql.core.tree.Node
anyMatch, children, collect, collectFirstChildren, collectLeaves, doCollectFirst, forEachDown, forEachDown, forEachProperty, forEachPropertyDown, forEachPropertyOnly, forEachPropertyUp, forEachUp, forEachUp, nodeName, nodeProperties, replaceChildrenSameSize, source, sourceLocation, sourceText, transformChildren, transformDown, transformDown, transformNodeProps, transformPropertiesDown, transformPropertiesOnly, transformPropertiesUp, transformUp, transformUp
-
Field Details
-
ENTRY
-
TRUE
-
FALSE
-
NULL
-
-
Constructor Details
-
Literal
-
-
Method Details
-
writeTo
- Throws:
IOException
-
getWriteableName
-
info
Description copied from class:NodeReturn the information about this node.Normally, you want to use one of the static
createmethods 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 of 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>
-
value
-
foldable
public boolean foldable()Description copied from class:ExpressionWhether the expression can be evaluated statically, aka "folded", or not.- Overrides:
foldablein classExpression
-
nullable
- Specified by:
nullablein classExpression
-
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.- Specified by:
dataTypein classExpression
-
resolved
public boolean resolved()- Specified by:
resolvedin interfaceResolvable- Overrides:
resolvedin classExpression
-
fold
Description copied from class:ExpressionEvaluate this expression statically to a constant. It is an error to call this ifExpression.foldable()returns false.- Overrides:
foldin classExpression
-
hashCode
public int hashCode()- Overrides:
hashCodein classNode<Expression>
-
equals
- Overrides:
equalsin classNode<Expression>
-
toString
- Overrides:
toStringin classExpression
-
nodeString
- Overrides:
nodeStringin classNode<Expression>
-
of
Utility method for creating a literal out of a foldable expression. Throws an exception if the expression is not foldable. -
of
-