test(integration): RS_Envelope, RS_ConvexHull, RS_PixelAs* parity (item-level-CRS geometry in the harness) - #1286
Open
james-willis wants to merge 2 commits into
Open
Conversation
SedonaDB returns geometry whose CRS can vary per row (RS_Envelope, RS_PixelAsPoint, ...) as struct<item: geoarrow.wkb, crs>, which the tuple stringifier could not cast. Render the geometry child as WKT like any other geometry column; the per-item crs field has no counterpart in other engines' results and stays covered through RS_CRS.
james-willis
force-pushed
the
jw/parity-geom-outputs
branch
from
September 11, 2026 19:44
2bfb419 to
a9cec68
Compare
james-willis
marked this pull request as ready for review
September 11, 2026 21:06
paleolimbot
reviewed
Sep 12, 2026
paleolimbot
left a comment
Member
There was a problem hiding this comment.
Integration tests look great! I'm not sold on the handling of item crs in the tuples converter, but also our current handling is not great either.
Comment on lines
+293
to
+298
| Geometry columns are rendered as WKT strings — including SedonaDB's | ||
| item-level-CRS geometry (``struct<item: geoarrow.wkb, crs>``, returned | ||
| by RS_Envelope and friends whose output CRS can vary per row), which is | ||
| unwrapped to its geometry child first; the per-item crs field has no | ||
| counterpart in other engines' results and is asserted through RS_CRS | ||
| coverage instead. List columns (e.g. the `List<Double>` returned by |
Member
There was a problem hiding this comment.
In this particular context, item crs could come back as {"item": <wkt>, "crs": <crs>} or (<wkt>, <crs>). I am not sure that ditching the CRS is a good idea for this specific function (you could always issue a separate query with just the geometry field if this is what you wanted to test?)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Completes parity coverage of the geometry-returning raster functions, closing out the batch #1264 unblocked: RS_Envelope, RS_ConvexHull, RS_PixelAsPoint, RS_PixelAsCentroid, RS_PixelAsPolygon — one file per function, every case probed on both engines first.
Harness: item-level-CRS geometry (first commit)
These five functions return geometry whose CRS can vary per row, which SedonaDB represents as
struct<item: geoarrow.wkb, crs>— the tuple stringifier could not cast it ("Unsupported cast from struct").result_to_tuplesnow unwraps the struct and renders the geometry child as WKT like any other geometry column (parent nulls propagated viapc.struct_field); the per-item crs field has no counterpart in the other engine's result and stays covered through the RS_CRS suite. RS_WorldToRasterCoord was unaffected because its pixel-space output carries no CRS.What the probes found
Mostly good news — four of the five functions agree exactly, anchored with exact WKT:
Two divergences, xfail-cataloged:
(0, 0)→POINT (98 503)); Sedona Spark raisesIndexOutOfBoundsException("Specified pixel coordinates (0, 0) do not lie in the raster") — even though Spark's own RS_PixelAsCentroid and RS_PixelAsPolygon extrapolate happily. An internal inconsistency on the Spark side.Full suite:
188 passed, 103 xfailed.With this, every dual-engine RS_ function has a parity file except RS_Values (list-column results; its coordinate-array overload also has no SQL spelling both engines parse) and RS_AsGeoTiff (binary output, no shared round-trip SQL).