Class SpatialRelatesFunction
- All Implemented Interfaces:
NamedWriteable,Writeable,TranslationAware,Resolvable,EvaluatorMapper,SurrogateExpression
- Direct Known Subclasses:
SpatialContains,SpatialDisjoint,SpatialIntersects,SpatialWithin
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.elasticsearch.xpack.esql.expression.function.scalar.spatial.BinarySpatialFunction
BinarySpatialFunction.BinarySpatialComparator<T>, BinarySpatialFunction.SpatialCrsTypeNested classes/interfaces inherited from class org.elasticsearch.xpack.esql.core.expression.Expression
Expression.TypeResolutionNested classes/interfaces inherited from interface org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper
EvaluatorMapper.ToEvaluatorNested 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.expression.function.scalar.spatial.BinarySpatialFunction
leftDocValues, rightDocValuesFields inherited from class org.elasticsearch.xpack.esql.core.expression.function.scalar.ScalarFunction
MAX_BYTES_REF_RESULT_SIZE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSpatialRelatesFunction(StreamInput in, boolean leftDocValues, boolean rightDocValues) protectedSpatialRelatesFunction(Source source, Expression left, Expression right, boolean leftDocValues, boolean rightDocValues) -
Method Summary
Modifier and TypeMethodDescriptionasQuery(LucenePushdownPredicates pushdownPredicates, TranslatorHandler handler) Translates the implementing expression into a Query.crsType()dataType()left()booleanabstract ShapeRelationright()booleansource()Some spatial functions can replace themselves with alternatives that are more efficient for certain cases.toEvaluator(EvaluatorMapper.ToEvaluator toEvaluator) Convert this into anEvalOperator.ExpressionEvaluator.translatable(LucenePushdownPredicates pushdownPredicates) Push-down to Lucene is only possible if one field is an indexed spatial field, and the other is a constant spatial or string column.Methods inherited from class org.elasticsearch.xpack.esql.expression.function.scalar.spatial.BinarySpatialFunction
crsType, equals, hashCode, leftDocValues, resolveType, rightDocValues, setCrsType, spatialCRSCompatible, withDocValues, writeToMethods 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, functionName, nodeString, nullableMethods inherited from class org.elasticsearch.xpack.esql.core.expression.Expression
canonical, canonicalize, childrenResolved, fold, propertiesToString, references, resolved, 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, info, 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.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
-
SpatialRelatesFunction
protected SpatialRelatesFunction(Source source, Expression left, Expression right, boolean leftDocValues, boolean rightDocValues) -
SpatialRelatesFunction
protected SpatialRelatesFunction(StreamInput in, boolean leftDocValues, boolean rightDocValues) throws IOException - Throws:
IOException
-
-
Method Details
-
queryRelation
-
dataType
- Specified by:
dataTypein classExpression
-
surrogate
Some spatial functions can replace themselves with alternatives that are more efficient for certain cases.- Specified by:
surrogatein interfaceSurrogateExpression
-
toEvaluator
public EvalOperator.ExpressionEvaluator.Factory toEvaluator(EvaluatorMapper.ToEvaluator toEvaluator) Description copied from interface:EvaluatorMapperConvert 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
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
EvalOperator.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
-
translatable
Description copied from class:BinarySpatialFunctionPush-down to Lucene is only possible if one field is an indexed spatial field, and the other is a constant spatial or string column.- Specified by:
translatablein interfaceTranslationAware- Overrides:
translatablein classBinarySpatialFunction
-
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
-
source
Source source() -
left
Expression left() -
right
Expression right() -
crsType
BinarySpatialFunction.SpatialCrsType crsType() -
leftDocValues
boolean leftDocValues() -
rightDocValues
boolean rightDocValues()
-