Class SpatialShapeBoundsExtraction
java.lang.Object
org.elasticsearch.xpack.esql.rule.Rule<AggregateExec,PhysicalPlan>
org.elasticsearch.xpack.esql.rule.ParameterizedRule<AggregateExec,PhysicalPlan,LocalPhysicalOptimizerContext>
org.elasticsearch.xpack.esql.optimizer.PhysicalOptimizerRules.ParameterizedOptimizerRule<AggregateExec,LocalPhysicalOptimizerContext>
org.elasticsearch.xpack.esql.optimizer.rules.physical.local.SpatialShapeBoundsExtraction
public class SpatialShapeBoundsExtraction
extends PhysicalOptimizerRules.ParameterizedOptimizerRule<AggregateExec,LocalPhysicalOptimizerContext>
This rule is responsible for marking spatial shape fields whose extent can be extracted from the binary representation encoded by
GeometryDocValueWriter.
This is a very specific optimization that is only used in the context of ST_EXTENT_AGG aggregations.
Normally spatial fields are extracted from source values because this maintains original precision, but is very slow.
Simply extracting the spatial bounds from the binary encoding loses both precision and geometry topological information for shapes.
For this reason we only consider extract the extent under very specific conditions:
- The spatial data is of type GEO_SHAPE or CARTESIAN_SHAPE.
- The spatial data is consumed directly by an
ST_EXTENT_AGG. - The spatial data is not consumed by any other operation. While is this is stricter than necessary,
it is a good enough approximation for now. For example, an aggregation like
countshouldn't stop this optimization, not a check likeisNotNull.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected PhysicalPlanrule(AggregateExec aggregate, LocalPhysicalOptimizerContext ctx) Methods inherited from class org.elasticsearch.xpack.esql.optimizer.PhysicalOptimizerRules.ParameterizedOptimizerRule
applyMethods inherited from class org.elasticsearch.xpack.esql.rule.ParameterizedRule
apply
-
Constructor Details
-
SpatialShapeBoundsExtraction
public SpatialShapeBoundsExtraction()
-
-
Method Details
-
rule
- Specified by:
rulein classPhysicalOptimizerRules.ParameterizedOptimizerRule<AggregateExec,LocalPhysicalOptimizerContext>
-