Class SpatialContains
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.core.expression.function.scalar.BinaryScalarFunction
org.elasticsearch.xpack.esql.expression.function.scalar.spatial.BinarySpatialFunction
org.elasticsearch.xpack.esql.expression.function.scalar.spatial.SpatialRelatesFunction
org.elasticsearch.xpack.esql.expression.function.scalar.spatial.SpatialContains
- All Implemented Interfaces:
NamedWriteable,Writeable,TranslationAware,Resolvable,EvaluatorMapper,SurrogateExpression
This is the primary class for supporting the function ST_CONTAINS.
The bulk of the capabilities are within the parent class SpatialRelatesFunction,
which supports all the relations in the ShapeField.QueryRelation enum.
Here we simply wire the rules together specific to ST_CONTAINS and QueryRelation.CONTAINS.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.xpack.esql.expression.function.scalar.spatial.SpatialRelatesFunction
SpatialRelatesFunction.SpatialRelationsNested 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
FieldsModifier and TypeFieldDescriptionstatic final org.elasticsearch.xpack.esql.expression.function.scalar.spatial.SpatialContains.SpatialRelationsContainsstatic final NamedWriteableRegistry.Entrystatic final org.elasticsearch.xpack.esql.expression.function.scalar.spatial.SpatialContains.SpatialRelationsContainsFields 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_SIZEFields inherited from class org.elasticsearch.xpack.esql.core.tree.Node
TO_STRING_MAX_WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncrsType()fold(FoldContext ctx) Evaluate this expression statically to a constant.protected NodeInfo<? extends Expression> info()Normally, you want to use one of the staticcreatemethods to implement this.left()booleanprotected SpatialContainsreplaceChildren(Expression newLeft, Expression newRight) right()booleansource()To keep the number of evaluators to a minimum, we swap the arguments to get the WITHIN relation.withDocValues(boolean foundLeft, boolean foundRight) Mark the function as expecting the specified fields to arrive as doc-values.Methods inherited from class org.elasticsearch.xpack.esql.expression.function.scalar.spatial.SpatialRelatesFunction
asQuery, dataType, toEvaluator, translatableMethods inherited from class org.elasticsearch.xpack.esql.expression.function.scalar.spatial.BinarySpatialFunction
crsType, equals, hashCode, leftDocValues, resolveType, rightDocValues, setCrsType, spatialCRSCompatible, writeToMethods inherited from class org.elasticsearch.xpack.esql.core.expression.function.scalar.BinaryScalarFunction
foldable, left, 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, propertiesToString, references, resolved, semanticEquals, semanticHash, toString, typeResolvedMethods inherited from class org.elasticsearch.xpack.esql.core.tree.Node
anyMatch, children, collect, collect, collect, collectFirstChildren, collectLeaves, doCollectFirst, forEachDown, forEachDown, forEachDownMayReturnEarly, 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.evaluator.mapper.EvaluatorMapper
foldMethods inherited from interface org.elasticsearch.xpack.esql.capabilities.TranslationAware
asLuceneQuery
-
Field Details
-
ENTRY
-
GEO
public static final org.elasticsearch.xpack.esql.expression.function.scalar.spatial.SpatialContains.SpatialRelationsContains GEO -
CARTESIAN
public static final org.elasticsearch.xpack.esql.expression.function.scalar.spatial.SpatialContains.SpatialRelationsContains CARTESIAN
-
-
Constructor Details
-
SpatialContains
-
-
Method Details
-
getWriteableName
-
queryRelation
- Specified by:
queryRelationin classSpatialRelatesFunction
-
withDocValues
Description copied from class:BinarySpatialFunctionMark the function as expecting the specified fields to arrive as doc-values.- Specified by:
withDocValuesin classBinarySpatialFunction
-
replaceChildren
- Specified by:
replaceChildrenin classBinaryScalarFunction
-
info
Description copied from class:NodeNormally, you want to use one of the staticcreatemethods 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 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>
-
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
-
surrogate
To keep the number of evaluators to a minimum, we swap the arguments to get the WITHIN relation. This also makes other optimizations, like lucene-pushdown, simpler to develop.- Specified by:
surrogatein interfaceSurrogateExpression- Overrides:
surrogatein classSpatialRelatesFunction
-
source
Source source() -
left
Expression left() -
right
Expression right() -
crsType
BinarySpatialFunction.SpatialCrsType crsType() -
leftDocValues
boolean leftDocValues() -
rightDocValues
boolean rightDocValues()
-