Class SpatialGridFunction
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.function.scalar.spatial.SpatialGridFunction
- All Implemented Interfaces:
NamedWriteable,Writeable,Resolvable,OptionalArgument,LicenseAware
public abstract class SpatialGridFunction
extends ScalarFunction
implements OptionalArgument, LicenseAware
Spatial functions that take one spatial argument, one parameter and one optional bounds can inherit from this class.
Obvious choices are: StGeohash, StGeotile and StGeohex.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfacestatic interfacePublic for use in integration testsNested 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 Expressionprotected final Expressionprotected final booleanprotected final ExpressionFields inherited from class org.elasticsearch.xpack.esql.core.expression.function.scalar.ScalarFunction
MAX_BYTES_REF_RESULT_SIZE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSpatialGridFunction(StreamInput in, boolean spatialDocsValues) protectedSpatialGridFunction(Source source, Expression spatialField, Expression parameter, Expression bounds, boolean spatialDocsValues) -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidaddGrids(LongBlock.Builder results, List<Long> gridIds) protected static GeoBoundingBoxasGeoBoundingBox(Object bounds) protected static GeoBoundingBoxasGeoBoundingBox(org.elasticsearch.geometry.Rectangle rectangle) protected static org.elasticsearch.geometry.RectangleasRectangle(org.apache.lucene.util.BytesRef boundsBytesRef) bounds()booleanbooleanfoldable()protected static voidfromEncodedLong(LongBlock.Builder results, int position, LongBlock encoded, int precision, SpatialGridFunction.UnboundedGrid unboundedGrid) protected static voidfromEncodedLong(LongBlock.Builder results, int position, LongBlock encoded, SpatialGridFunction.BoundedGrid bounds) protected static voidfromWKB(LongBlock.Builder results, int position, BytesRefBlock wkbBlock, int precision, SpatialGridFunction.UnboundedGrid unboundedGrid) protected static voidfromWKB(LongBlock.Builder results, int position, BytesRefBlock wkbBlock, SpatialGridFunction.BoundedGrid bounds) inthashCode()protected static Expression.TypeResolutionisGeoPoint(Expression e, String operationName) protected static Expression.TypeResolutionisGeoshape(Expression e, String operationName) booleanlicenseCheck(XPackLicenseState state) Return true if the implementer can be executed under the providedXPackLicenseState, otherwise false.final SpatialGridFunctionreplaceChildren(List<Expression> newChildren) protected abstract SpatialGridFunctionreplaceChildren(Expression newSpatialField, Expression newParameter, Expression newBounds) protected Expression.TypeResolutionbooleanabstract SpatialGridFunctionwithDocValues(boolean useDocValues) Mark the function as expecting the specified field to arrive as doc-values.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, 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, 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.common.io.stream.NamedWriteable
getWriteableName
-
Field Details
-
spatialField
-
parameter
-
bounds
-
spatialDocsValues
protected final boolean spatialDocsValues
-
-
Constructor Details
-
SpatialGridFunction
protected SpatialGridFunction(Source source, Expression spatialField, Expression parameter, Expression bounds, boolean spatialDocsValues) -
SpatialGridFunction
- Throws:
IOException
-
-
Method Details
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
licenseCheck
Description copied from interface:LicenseAwareReturn true if the implementer can be executed under the providedXPackLicenseState, otherwise false.- Specified by:
licenseCheckin interfaceLicenseAware
-
withDocValues
Mark the function as expecting the specified field to arrive as doc-values. This only applies to geo_point and cartesian_point types. -
resolveType
- Overrides:
resolveTypein classExpression
-
isGeoPoint
-
isGeoshape
-
asRectangle
protected static org.elasticsearch.geometry.Rectangle asRectangle(org.apache.lucene.util.BytesRef boundsBytesRef) -
asGeoBoundingBox
-
asGeoBoundingBox
-
hashCode
public int hashCode() -
equals
-
spatialDocsValues
public boolean spatialDocsValues() -
replaceChildren
- Specified by:
replaceChildrenin classNode<Expression>
-
replaceChildren
protected abstract SpatialGridFunction replaceChildren(Expression newSpatialField, Expression newParameter, Expression newBounds) -
spatialField
-
parameter
-
bounds
-
foldable
public boolean foldable()- Overrides:
foldablein classExpression
-
addGrids
-
fromWKB
protected static void fromWKB(LongBlock.Builder results, int position, BytesRefBlock wkbBlock, int precision, SpatialGridFunction.UnboundedGrid unboundedGrid) -
fromEncodedLong
protected static void fromEncodedLong(LongBlock.Builder results, int position, LongBlock encoded, int precision, SpatialGridFunction.UnboundedGrid unboundedGrid) -
fromWKB
protected static void fromWKB(LongBlock.Builder results, int position, BytesRefBlock wkbBlock, SpatialGridFunction.BoundedGrid bounds) -
fromEncodedLong
protected static void fromEncodedLong(LongBlock.Builder results, int position, LongBlock encoded, SpatialGridFunction.BoundedGrid bounds)
-