Class BinaryLogic
- All Implemented Interfaces:
NamedWriteable,Writeable,TranslationAware,Resolvable,EvaluatorMapper,ExpressionScoreMapper
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.xpack.esql.core.expression.Expression
Expression.TypeResolutionNested classes/interfaces inherited from class org.elasticsearch.xpack.esql.core.tree.Node
Node.NodeStringFormatNested classes/interfaces inherited from interface org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper
EvaluatorMapper.ToEvaluatorNested classes/interfaces inherited from interface org.elasticsearch.xpack.esql.score.ExpressionScoreMapper
ExpressionScoreMapper.ToScorerNested classes/interfaces inherited from interface org.elasticsearch.xpack.esql.capabilities.TranslationAware
TranslationAware.FinishedTranslatable, TranslationAware.SingleValueTranslationAware, TranslationAware.TranslatableNested 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.expression.function.scalar.ScalarFunction
MAX_BYTES_REF_RESULT_SIZEFields inherited from class org.elasticsearch.xpack.esql.core.tree.Node
TO_STRING_MAX_LINES, TO_STRING_MAX_WIDTH -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedBinaryLogic(Source source, Expression left, Expression right, BinaryLogicOperation operation) -
Method Summary
Modifier and TypeMethodDescriptionasQuery(LucenePushdownPredicates pushdownPredicates, TranslatorHandler handler) Translates the implementing expression into a Query.static QuerydataType()TheDataTypereturned by executing the tree rooted at this expression.protected booleannullable()protected Expression.TypeResolutionresolveInputType(Expression e, TypeResolutions.ParamOrdinal paramOrdinal) toEvaluator(EvaluatorMapper.ToEvaluator toEvaluator) Convert this into anExpressionEvaluator.toScorer(ExpressionScoreMapper.ToScorer toScorer) translatable(LucenePushdownPredicates pushdownPredicates) Can this instance be translated or not? Usually checks whether the expression arguments are actual fields that exist in Lucene.final voidwriteTo(StreamOutput out) Methods inherited from class org.elasticsearch.xpack.esql.core.expression.predicate.BinaryOperator
canonicalize, collectCommutative, resolveType, swapLeftAndRightMethods inherited from class org.elasticsearch.xpack.esql.core.expression.predicate.BinaryPredicate
equals, fold, function, hashCode, nodeString, symbolMethods inherited from class org.elasticsearch.xpack.esql.core.expression.function.scalar.BinaryScalarFunction
foldable, left, replaceChildren, replaceChildren, rightMethods inherited from class org.elasticsearch.xpack.esql.core.expression.function.Function
arguments, functionNameMethods inherited from class org.elasticsearch.xpack.esql.core.expression.Expression
canonical, childrenResolved, propertiesToString, references, resolved, semanticEquals, semanticHash, toString, toString, typeResolvedMethods 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, info, nodeName, nodeProperties, nodeString, replaceChildrenSameSize, source, sourceLocation, sourceText, 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.evaluator.mapper.EvaluatorMapper
foldMethods inherited from interface org.elasticsearch.common.io.stream.NamedWriteable
getWriteableNameMethods inherited from interface org.elasticsearch.xpack.esql.capabilities.TranslationAware
asLuceneQuery
-
Constructor Details
-
BinaryLogic
protected BinaryLogic(Source source, Expression left, Expression right, BinaryLogicOperation operation) -
BinaryLogic
- Throws:
IOException
-
-
Method Details
-
writeTo
- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classBinaryScalarFunction- Throws:
IOException
-
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
-
resolveInputType
protected Expression.TypeResolution resolveInputType(Expression e, TypeResolutions.ParamOrdinal paramOrdinal) - Specified by:
resolveInputTypein classBinaryOperator<Boolean,Boolean, Boolean, BinaryLogicOperation>
-
nullable
-
isCommutative
protected boolean isCommutative()- Overrides:
isCommutativein classBinaryOperator<Boolean,Boolean, Boolean, BinaryLogicOperation>
-
translatable
Description copied from interface:TranslationAwareCan this instance be translated or not? Usually checks whether the expression arguments are actual fields that exist in Lucene. SeeTranslationAware.Translatablefor precisely what can be signaled from this method.- Specified by:
translatablein interfaceTranslationAware
-
asQuery
Description copied from interface:TranslationAwareTranslates the implementing expression into a Query. If during translation a child needs to be translated first, the handler needs to be used even if the child implements this interface as well. This is to ensure that the child is wrapped in a SingleValueQuery if necessary.So use this:
Query childQuery = handler.asQuery(child);and not this:
Query childQuery = child.asQuery(handler);- Specified by:
asQueryin interfaceTranslationAware
-
boolQuery
-
toScorer
- Specified by:
toScorerin interfaceExpressionScoreMapper
-
toEvaluator
Description copied from interface:EvaluatorMapperConvert this into anExpressionEvaluator.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
Expressionand 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
ExpressionEvaluator.Factoryfor 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 ofExpressionthen "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.- Specified by:
toEvaluatorin interfaceEvaluatorMapper
-