pranav-walimbe opened a new pull request, #1043: URL: https://github.com/apache/sedona-db/pull/1043
## Summary - Adds `ST_ConvexHull_Agg`, a grouped aggregate that computes the convex hull of all geometries in a group directly instead of going through `ST_Area(ST_ConvexHull(ST_Collect_Agg(g)))` - Accumulates raw coordinates per group and computes the hull once at emit time using `geo`'s `quick_hull` which avoids intermediate WKB collection - Byte-identical output to the old chain on all tested cases (degenerate collapses, structural inputs, random hulls) - Mixed-dimension groups now error to match `ST_Collect_Agg`'s existing behavior ## Perf 3.8–6.8x faster than the old chain depending on group size - 8 points/group: 36.3 ms → 5.3 ms (6.8x) - 100 points/group: 13.4 ms → 3.5 ms (3.8x) - 1000 points/group: 11.3 ms → 2.3 ms (4.8x) ## Also included - Extracted `visit_xy_coords` in `sedona-geometry`, so `ST_Envelope_Agg` and this aggregate don't reimplement identical logic - `benchmarks/test_aggregates.py` now runs the stage-by-stage comparison across SedonaDB, PostGIS, and DuckDB - Added the SQL reference doc (`docs/reference/sql/st_convexhull_agg.qmd`) ## Testing - [x] `cargo test -p sedona-geo st_convexhull_agg` - [x] `pytest test_aggregates.py` for perf difference -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
