Class StGeotile
- All Implemented Interfaces:
NamedWriteable,Writeable,Resolvable,EvaluatorMapper,OptionalArgument,LicenseAware
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classWhen checking tiles with bounds, we need to check if the tile is valid (intersects with the bounds).Nested classes/interfaces inherited from class org.elasticsearch.xpack.esql.expression.function.scalar.spatial.SpatialGridFunction
SpatialGridFunction.BoundedGrid, SpatialGridFunction.UnboundedGridNested 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.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final NamedWriteableRegistry.Entrystatic final SpatialGridFunction.UnboundedGridFor unbounded grids, we don't need to check if the tile is valid, just calculate the encoded long intersecting the point at that precision.Fields inherited from class org.elasticsearch.xpack.esql.expression.function.scalar.spatial.SpatialGridFunction
bounds, parameter, spatialFieldFields inherited from class org.elasticsearch.xpack.esql.expression.function.scalar.spatial.SpatialDocValuesFunction
spatialDocValuesFields 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
ConstructorsConstructorDescriptionStGeotile(Source source, Expression field, Expression precision, Expression bounds) -
Method Summary
Modifier and TypeMethodDescriptiondataType()TheDataTypereturned by executing the tree rooted at this expression.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.protected SpatialGridFunctionreplaceChildren(Expression newSpatialField, Expression newParameter, Expression newBounds) static org.apache.lucene.util.BytesReftoBounds(long gridId) toEvaluator(EvaluatorMapper.ToEvaluator toEvaluator) Convert this into anEvalOperator.ExpressionEvaluator.withDocValues(boolean useDocValues) Mark the function as expecting the specified field to arrive as doc-values.Methods inherited from class org.elasticsearch.xpack.esql.expression.function.scalar.spatial.SpatialGridFunction
addGrids, asGeoBoundingBox, asGeoBoundingBox, asRectangle, bounds, foldable, fromEncodedLong, fromEncodedLong, fromWKB, fromWKB, isGeoPoint, isGeoshape, licenseCheck, parameter, replaceChildren, resolveType, spatialField, writeToMethods inherited from class org.elasticsearch.xpack.esql.expression.function.scalar.spatial.SpatialDocValuesFunction
equals, hashCode, prefersDocValuesExtraction, spatialDocValuesMethods 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
fold
-
Field Details
-
ENTRY
-
unboundedGrid
For unbounded grids, we don't need to check if the tile is valid, just calculate the encoded long intersecting the point at that precision.
-
-
Constructor Details
-
StGeotile
-
-
Method Details
-
withDocValues
Description copied from class:SpatialDocValuesFunctionMark the function as expecting the specified field to arrive as doc-values. This only applies to geo_point and cartesian_point types.- Specified by:
withDocValuesin classSpatialDocValuesFunction
-
getWriteableName
- Specified by:
getWriteableNamein interfaceNamedWriteable
-
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
-
replaceChildren
protected SpatialGridFunction replaceChildren(Expression newSpatialField, Expression newParameter, Expression newBounds) - Specified by:
replaceChildrenin classSpatialGridFunction
-
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>
-
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
-
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
-
toBounds
public static org.apache.lucene.util.BytesRef toBounds(long gridId)
-