Class DateDiff
- All Implemented Interfaces:
NamedWriteable
,Writeable
,Resolvable
,EvaluatorMapper
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
static interface
static enum
Represents units that can be used for DATE_DIFF function and how the difference between 2 dates is calculatedNested classes/interfaces inherited from class org.elasticsearch.xpack.esql.core.expression.Expression
Expression.TypeResolution
Nested classes/interfaces inherited from interface org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper
EvaluatorMapper.ToEvaluator
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDateDiff
(Source source, Expression unit, Expression startTimestamp, Expression endTimestamp) -
Method Summary
Modifier and TypeMethodDescriptiondataType()
boolean
foldable()
protected NodeInfo
<? extends Expression> info()
replaceChildren
(List<Expression> newChildren) protected Expression.TypeResolution
toEvaluator
(EvaluatorMapper.ToEvaluator toEvaluator) Convert this into anEvalOperator.ExpressionEvaluator
.void
writeTo
(StreamOutput out) Methods inherited from class org.elasticsearch.xpack.esql.expression.function.scalar.EsqlScalarFunction
fold
Methods inherited from class org.elasticsearch.xpack.esql.core.expression.function.Function
arguments, equals, functionName, hashCode, nodeString, nullable
Methods inherited from class org.elasticsearch.xpack.esql.core.expression.Expression
canonical, canonicalize, childrenResolved, propertiesToString, references, resolved, semanticEquals, semanticHash, toString, typeResolved
Methods 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
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper
fold
-
Field Details
-
ENTRY
-
UTC
-
-
Constructor Details
-
DateDiff
-
-
Method Details
-
writeTo
- Throws:
IOException
-
getWriteableName
-
toEvaluator
public EvalOperator.ExpressionEvaluator.Factory toEvaluator(EvaluatorMapper.ToEvaluator toEvaluator) Description copied from interface:EvaluatorMapper
Convert this into anEvalOperator.ExpressionEvaluator
.Note for implementors: If you are implementing this function, you should call the passed-in lambda on your children, after doing any other manipulation (casting, etc.) necessary.
Note for Callers: If you are attempting to call this method, and you have an
Expression
and aLayout
, you likely want to callEvalMapper.toEvaluator(org.elasticsearch.xpack.esql.core.expression.FoldContext, org.elasticsearch.xpack.esql.core.expression.Expression, org.elasticsearch.xpack.esql.planner.Layout)
instead. On the other hand, if you already have something that looks like the parameter for this method, you should call this method with that function.Build an
EvalOperator.ExpressionEvaluator.Factory
for the tree of expressions rooted at this node. This is only guaranteed to return a sensible evaluator if this node has a valid type. If this node is a subclass ofExpression
then "valid type" means thatExpression.typeResolved()
returns a non-error resolution. If Expression.typeResolved() returns an error then this method may throw. Or return an evaluator that produces garbage. Or return an evaluator that throws when run. -
resolveType
- Overrides:
resolveType
in classExpression
-
foldable
public boolean foldable()- Overrides:
foldable
in classExpression
-
dataType
- Specified by:
dataType
in classExpression
-
replaceChildren
- Specified by:
replaceChildren
in classNode<Expression>
-
info
- Specified by:
info
in classNode<Expression>
-