Skip to content

Conversation

@craigtaverner
Copy link
Contributor

@craigtaverner craigtaverner commented Dec 16, 2025

Various fixes to spatial functions:

  • Made ST_ENVELOPE multi-value aware
  • Added ST_NPOINTS
  • Refactored doc-values support (so ST_ENVELOPE, ST_NPOINTS and all geogrid functions are similar)
  • Supported doc-values in ST_X/Y and ST_XYMAX/MIN
  • Support multi-values in ST_X/YMAX/MIN

This last point is interesting. Because ST_X and ST_Y use @ConvertEvaluator, they support multi-values by converting each internal value, which makes sense for points, since we cannot collect points into a MultiPoint and perform ST_X/ST_Y on the multipoint. However, for ST_XMAX, ST_XMIN, ST_YMAX and ST_YMIN we can follow the convention we are using elsewhere in spatial functions, and collect the multi-values into a geometry collection. This means that, for example, ST_XMAX(field) will return the maximum x value for all values in the multi-value, whether they are points, shapes or a mixture.

Checklist:

  • Make ST_ENVELOPE multi-value aware (so we get envelopes of multi-points, and geometry collections)
  • Add ST_NPOINTS and make it multi-value aware
  • Make these two and all geogrid functions similarly doc-values enabled
  • Expand csv-tests (spatial.csv-spec for multi-point, and spatial_shapes.csv_spec for shapes)
  • Expand PhysicalPlanOptimizerTests to verify all doc-values combinations work
  • Support doc-values in ST_X, ST_Y, ST_XMAX, etc.
  • Support multivalues for ST_XMAX, ST_XMIN, ST_YMAX, ST_YMIN as geometry collections
  • Link ST_NPOINTS into docs
  • Update docs related to multi-values in spatial types

* Made ST_ENVELOPE multi-value aware
* Added ST_NPOINTS
* Refactored doc-values support (so ST_ENVELOPE, ST_NPOINTS and all geogrid functions are similar)
@craigtaverner craigtaverner added >enhancement :Analytics/Geo Indexing, search aggregations of geo points and shapes Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) :Analytics/ES|QL AKA ESQL labels Dec 16, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@elasticsearchmachine
Copy link
Collaborator

Hi @craigtaverner, I've created a changelog YAML for you.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 16, 2025

🔍 Preview links for changed docs

@github-actions
Copy link
Contributor

ℹ️ Important: Docs version tagging

👋 Thanks for updating the docs! Just a friendly reminder that our docs are now cumulative. This means all 9.x versions are documented on the same page and published off of the main branch, instead of creating separate pages for each minor version.

We use applies_to tags to mark version-specific features and changes.

Expand for a quick overview

When to use applies_to tags:

✅ At the page level to indicate which products/deployments the content applies to (mandatory)
✅ When features change state (e.g. preview, ga) in a specific version
✅ When availability differs across deployments and environments

What NOT to do:

❌ Don't remove or replace information that applies to an older version
❌ Don't add new information that applies to a specific version without an applies_to tag
❌ Don't forget that applies_to tags can be used at the page, section, and inline level

🤔 Need help?

And write a test that shows this working
@elasticsearchmachine
Copy link
Collaborator

Hi @craigtaverner, I've updated the changelog YAML for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL :Analytics/Geo Indexing, search aggregations of geo points and shapes >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants