jiayuasu opened a new pull request, #2898:
URL: https://github.com/apache/sedona/pull/2898

   ## Did you read the Contributor Guide?
   
   - Yes, I have read the [Contributor 
Rules](https://sedona.apache.org/latest/community/rule/) and [Contributor 
Development Guide](https://sedona.apache.org/latest/community/develop/)
   
   ## Is this PR related to a ticket?
   
   - Yes, and the PR name follows the format \`[GH-XXX] my subject\`. Closes 
#2884
   
   ## What changes were proposed in this PR?
   
   Adds the \`ST_Extent(geom)\` aggregate, returning a \`Box2D\` (the union of 
all bounding boxes in the column). PostGIS-compatible.
   
   \`\`\`sql
   SELECT ST_Extent(geom) FROM my_table;
   -- BOX(xmin ymin, xmax ymax)
   \`\`\`
   
   Reuses the existing \`EnvelopeBuffer\` reducer/merger from 
\`ST_Envelope_Aggr\`; only the \`finish\` step differs — \`Box2D\` instead of a 
polygon \`Geometry\`. \`ST_Envelope_Aggr\` is left untouched for backwards 
compatibility.
   
   Behavior:
   - Empty input (zero rows) → NULL.
   - All rows null or empty geometry → NULL.
   - Mixed null/empty/valid rows → bbox of the valid rows only; null and empty 
rows are ignored.
   
   ## How was this patch tested?
   
   \`aggregateFunctionTestScala\`:
   - \"Passed ST_Extent\" — three geometries (two points + one linestring) 
reduce to the expected box.
   - \"ST_Extent returns null over zero rows\" — empty input filtered to zero 
rows → NULL.
   - \"ST_Extent returns null when all inputs are null or empty\" — 
all-null/empty input → NULL.
   - \"ST_Extent ignores null and empty rows mixed with valid geometries\" — 
mixed input reflects valid geometries only.
   
   ## Did this PR include necessary documentation updates?
   
   - No, this PR does not affect any public SQL API documentation surface in 
isolation. Documentation for \`ST_Extent\` lands with the rest of the Phase 1 
surface (#2877) once the cast/text functions exist. Scala DataFrame API 
wrappers tracked separately in #2891.


-- 
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]

Reply via email to