jiayuasu opened a new pull request, #2930: URL: https://github.com/apache/sedona/pull/2930
## 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 #2925 ## What changes were proposed in this PR? Adds Box2D variants of `ST_Expand` alongside the existing Geometry-input overloads: - `ST_Expand(box: Box2D, units: double) -> Box2D` — uniform expansion on both axes - `ST_Expand(box: Box2D, dx: double, dy: double) -> Box2D` — per-axis expansion PostGIS-compatible. NULL on null input. Negative deltas are allowed; if a negative delta produces `xmin > xmax` or `ymin > ymax`, the result is returned as-is so callers can detect the degenerate bbox via the accessor functions (matches the Phase 1 design where `xmin > xmax` is reserved for future antimeridian-wraparound semantics rather than treated as in-band empty). ### Where the changes land | Layer | Change | |---|---| | `common/.../Functions.java` | Two new `expand(Box2D, ...)` overloads | | `spark/common/.../expressions/Functions.scala` | `ST_Expand` case class extended with two new `inferrableFunction*` overloads (Geometry overloads kept) | | `flink/.../expressions/Functions.java` | Two new `eval(Box2D, ...)` methods on the existing `ST_Expand` class | | Python / Scala DataFrame API / Flink Catalog | No change — wrappers were already polymorphic over `Column`, JVM-side overload resolution handles Box2D vs Geometry | ## How was this patch tested? - `common/.../FunctionsTest.java` — `expandBox2D` (uniform, per-axis, negative delta producing degenerate output, NULL input). - `spark/common/.../functionTestScala.scala` — "Passed ST_Expand for Box2D" (uniform, per-axis, shrink, NULL Box2D input). - `flink/.../FunctionTest.java` — `testExpandBox2D` (uniform + per-axis through Flink Table API). - `python/tests/sql/test_function.py` — `test_st_expand_box_2d` (uniform + per-axis through PySpark SQL with `Box2D` Python deserialization). ## Did this PR include necessary documentation updates? - No, this PR does not affect any public SQL API documentation surface in isolation. Documentation for the Phase 1 + Phase 2 Box2D surface (#2877) lands as a single coherent docs update once the deferred follow-ups (predicates #2926, implicit cast #2927, Box3D #2928, geography bboxes #2929) are scoped. -- 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]
