Class BinarySpatialFunction
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
- All Implemented Interfaces:
NamedWriteable,Writeable,Resolvable
- Direct Known Subclasses:
SpatialRelatesFunction,StDistance
Spatial functions that take two arguments that must both be spatial types can inherit from this class.
This provides common support for type resolution and validation. Ensuring that both arguments are spatial types
and of compatible CRS. For example geo_point and geo_shape can be compared, but not geo_point and cartesian_point.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classstatic enumFor most spatial functions we only need to know if the CRS is geo or cartesian, not whether the type is point or shape.Nested classes/interfaces inherited from class org.elasticsearch.xpack.esql.core.expression.Expression
Expression.TypeResolutionNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanprotected final booleanFields inherited from class org.elasticsearch.xpack.esql.core.expression.function.scalar.ScalarFunction
MAX_BYTES_REF_RESULT_SIZE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBinarySpatialFunction(StreamInput in, boolean leftDocValues, boolean rightDocValues, boolean pointsOnly) protectedBinarySpatialFunction(Source source, Expression left, Expression right, boolean leftDocValues, boolean rightDocValues, boolean pointsOnly) -
Method Summary
Modifier and TypeMethodDescriptioncrsType()booleaninthashCode()left()booleanprotected Expression.TypeResolutionright()booleanvoidsetCrsType(DataType dataType) source()protected static booleanspatialCRSCompatible(DataType spatialDataType, DataType otherDataType) booleantranslatable(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.abstract BinarySpatialFunctionwithDocValues(boolean foundLeft, boolean foundRight) Mark the function as expecting the specified fields to arrive as doc-values.voidwriteTo(StreamOutput out) Methods 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, dataType, 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, transformNodeProps, transformPropertiesDown, transformPropertiesOnly, transformPropertiesUp, transformUp, transformUpMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.common.io.stream.NamedWriteable
getWriteableName
-
Field Details
-
leftDocValues
protected final boolean leftDocValues -
rightDocValues
protected final boolean rightDocValues
-
-
Constructor Details
-
BinarySpatialFunction
protected BinarySpatialFunction(Source source, Expression left, Expression right, boolean leftDocValues, boolean rightDocValues, boolean pointsOnly) -
BinarySpatialFunction
protected BinarySpatialFunction(StreamInput in, boolean leftDocValues, boolean rightDocValues, boolean pointsOnly) throws IOException - Throws:
IOException
-
-
Method Details
-
writeTo
- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classBinaryScalarFunction- Throws:
IOException
-
withDocValues
Mark the function as expecting the specified fields to arrive as doc-values. -
hashCode
public int hashCode() -
equals
-
resolveType
- Overrides:
resolveTypein classExpression
-
setCrsType
-
spatialCRSCompatible
-
crsType
-
leftDocValues
public boolean leftDocValues() -
rightDocValues
public boolean rightDocValues() -
translatable
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. -
source
Source source() -
left
Expression left() -
right
Expression right()
-