Closed craigtaverner closed 2 days ago
Pinging @elastic/es-analytical-engine (Team:Analytics)
The problem is the physical plan optimizer does not consider whether a field has doc-values or not when planning a doc-values extraction for spatial fields used in ST_CENTROID_AGG. This consideration is a trivial addition to the allowedForDocValues
method, so should be very easy to fix.
When a point field is used only for aggregating in
ST_CENTROID_AGG
, then the field extraction is switched to extract doc-values for higher performance:However, if the index field mapping is mapped with out doc values:
This this query will fail:
The message
BYTES_REF NOT IN (NULL, LONG)
basically means that what was actually read from the store wasBYTES_REF
(as expected for geo_point from source), but what the reader expected to see from the field type wasLONG
(as expected from geo_point from doc-values).