Class Range
java.lang.Object
org.elasticsearch.xpack.esql.core.tree.Node<Expression>
org.elasticsearch.xpack.esql.core.expression.Expression
org.elasticsearch.xpack.esql.core.expression.function.Function
org.elasticsearch.xpack.esql.core.expression.function.scalar.ScalarFunction
org.elasticsearch.xpack.esql.expression.predicate.Range
- All Implemented Interfaces:
NamedWriteable,Writeable,TranslationAware,TranslationAware.SingleValueTranslationAware,Resolvable
-
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.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_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionRange(Source src, Expression value, Expression lower, boolean inclLower, Expression upper, boolean inclUpper, ZoneId zoneId) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanareBoundariesInvalid(Object lowerValue, Object upperValue) Check whether the boundaries are invalid ( upper < lower) or not.asQuery(LucenePushdownPredicates pushdownPredicates, TranslatorHandler handler) Translates the implementing expression into a Query.dataType()booleanfold(FoldContext ctx) booleanfoldable()In case that the range is empty due to foldable, invalid bounds, but the bounds themselves are not yet folded, the optimizer will need two passes to fold this.inthashCode()booleanbooleaninfo()lower()replaceChildren(List<Expression> newChildren) Returns the field that only supports single-value semantics.translatable(LucenePushdownPredicates pushdownPredicates) Can this instance be translated or not? Usually checks whether the expression arguments are actual fields that exist in Lucene.upper()value()voidwriteTo(StreamOutput out) zoneId()Methods inherited from class org.elasticsearch.xpack.esql.core.expression.function.Function
arguments, functionName, nodeString, nullableMethods inherited from class org.elasticsearch.xpack.esql.core.expression.Expression
canonical, canonicalize, childrenResolved, propertiesToString, references, resolved, resolveType, semanticEquals, semanticHash, toString, 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, 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.xpack.esql.capabilities.TranslationAware
asLuceneQuery
-
Constructor Details
-
Range
public Range(Source src, Expression value, Expression lower, boolean inclLower, Expression upper, boolean inclUpper, ZoneId zoneId)
-
-
Method Details
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
getWriteableName
- Specified by:
getWriteableNamein interfaceNamedWriteable
-
info
- Specified by:
infoin classNode<Expression>
-
replaceChildren
- Specified by:
replaceChildrenin classNode<Expression>
-
value
-
lower
-
upper
-
includeLower
public boolean includeLower() -
includeUpper
public boolean includeUpper() -
zoneId
-
foldable
public boolean foldable()In case that the range is empty due to foldable, invalid bounds, but the bounds themselves are not yet folded, the optimizer will need two passes to fold this. That's because we shouldn't perform folding when trying to determine foldability.- Overrides:
foldablein classExpression
-
fold
- Overrides:
foldin classExpression
-
areBoundariesInvalid
Check whether the boundaries are invalid ( upper < lower) or not. If they are, the value does not have to be evaluated. -
dataType
- Specified by:
dataTypein classExpression
-
hashCode
public int hashCode() -
equals
-
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
-
singleValueField
Description copied from interface:TranslationAware.SingleValueTranslationAwareReturns the field that only supports single-value semantics.- Specified by:
singleValueFieldin interfaceTranslationAware.SingleValueTranslationAware
-