Class BinarySpatialGeometryFunction
- All Implemented Interfaces:
NamedWriteable,Writeable,Resolvable,EvaluatorMapper
- Direct Known Subclasses:
StDifference,StIntersection,StSymDifference,StUnion
Unlike SpatialRelatesFunction, these functions are not predicates and cannot be pushed
down to Lucene. They are expected to appear in EVAL commands and return geo_shape or
cartesian_shape results.
Both arguments must be spatial and must share the same coordinate reference system (geo or
cartesian). Either or both arguments may be point fields accessed via doc-values; in that case
the function is marked using withDocValues(boolean, boolean) during local physical
planning so that the correct evaluator variant is chosen.
-
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.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Expressionprotected final booleanprotected final Expressionprotected final booleanFields 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
ConstructorsModifierConstructorDescriptionprotectedBinarySpatialGeometryFunction(Source source, Expression left, Expression right, boolean leftDocValues, boolean rightDocValues) -
Method Summary
Modifier and TypeMethodDescriptiondataType()TheDataTypereturned by executing the tree rooted at this expression.booleanfold(FoldContext ctx) Evaluate this expression statically to a constant.booleanfoldable()Whether the expression can be evaluated statically, aka "folded", or not.inthashCode()protected abstract org.locationtech.jts.geom.GeometryjtsOperation(org.locationtech.jts.geom.Geometry leftGeom, org.locationtech.jts.geom.Geometry rightGeom) Apply the concrete JTS geometry operation (union, intersection, difference, or symDifference).left()booleanprotected Expression.TypeResolutionThe implementation ofExpression.typeResolved(), which is just a caching wrapper around this method.right()booleanabstract BinarySpatialGeometryFunctionwithDocValues(boolean foundLeft, boolean foundRight) Return a copy of this function with the specified doc-values flags set.voidwriteTo(StreamOutput out) 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, 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, replaceChildren, replaceChildrenSameSize, source, sourceLocation, sourceText, toString, 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
fold, toEvaluatorMethods inherited from interface org.elasticsearch.common.io.stream.NamedWriteable
getWriteableName
-
Field Details
-
left
-
right
-
leftDocValues
protected final boolean leftDocValues -
rightDocValues
protected final boolean rightDocValues
-
-
Constructor Details
-
BinarySpatialGeometryFunction
protected BinarySpatialGeometryFunction(Source source, Expression left, Expression right, boolean leftDocValues, boolean rightDocValues)
-
-
Method Details
-
writeTo
- Throws:
IOException
-
left
-
right
-
leftDocValues
public boolean leftDocValues() -
rightDocValues
public boolean rightDocValues() -
withDocValues
Return a copy of this function with the specified doc-values flags set. Only point types support doc-values access; shape types are always read from source. -
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
-
foldable
public boolean foldable()Description copied from class:ExpressionWhether the expression can be evaluated statically, aka "folded", or not.- Overrides:
foldablein classExpression
-
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 classEsqlScalarFunction
-
jtsOperation
protected abstract org.locationtech.jts.geom.Geometry jtsOperation(org.locationtech.jts.geom.Geometry leftGeom, org.locationtech.jts.geom.Geometry rightGeom) Apply the concrete JTS geometry operation (union, intersection, difference, or symDifference). -
resolveType
Description copied from class:ExpressionThe implementation ofExpression.typeResolved(), which is just a caching wrapper around this method. See it's javadoc for what this method should return.Implementations will rarely interact with the
Expression.TypeResolutionclass directly, instead usually calling the utility methods onTypeResolutions.Implementations should fail if
Expression.childrenResolved()returnsfalse.- Overrides:
resolveTypein classExpression
-
hashCode
public int hashCode() -
equals
-