jiayuasu opened a new pull request, #2906: URL: https://github.com/apache/sedona/pull/2906
## 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 #2888 ## What changes were proposed in this PR? Mirrors the Phase 1 Box2D SQL surface in the Flink module. ### Type system - `flink/src/main/java/org/apache/sedona/flink/Box2DTypeSerializer.java` — Flink `TypeSerializer<Box2D>`. Same shape as `GeometryTypeSerializer` (used as a `RAW` data type via `@DataTypeHint(rawSerializer = ..., bridgedTo = ...)`). Encodes a presence byte plus four doubles. ### Scalars and aggregate | Function | Module | Notes | |---|---|---| | `ST_Box2D(geom)` | `Functions` | scalar | | `ST_MakeBox2D(p1, p2)` | `Constructors` | scalar | | `ST_GeomFromBox2D(box)` | `Constructors` | scalar; dispatches POLYGON/POINT/LINESTRING | | `ST_Extent(geom)` | `Aggregators` | aggregate, returns Box2D, NULL over zero rows | | `ST_XMin/XMax/YMin/YMax(box)` | `Functions` | new `eval(Box2D)` overloads on the existing classes | | `ST_AsText(box)` | `Functions` | new `eval(Box2D)` overload returning `BOX(...)` | Plus Catalog registration for the four new top-level functions (`ST_Box2D`, `ST_MakeBox2D`, `ST_GeomFromBox2D`, `ST_Extent`). ## How was this patch tested? - `flink/src/test/.../FunctionTest.java` — `testBox2D` (happy path + NULL propagation), `testBox2DAsTextAndAccessors` (BOX format and the four 2D accessors against a Box2D value). - `flink/src/test/.../ConstructorTest.java` — `testMakeBox2D` (happy path), `testGeomFromBox2D` (POLYGON + degenerate POINT cases through ST_AsText). - `flink/src/test/.../AggregatorTest.java` — `testExtent` (happy path), `testExtent_EmptyAndNullGeometries` (NULL/empty input → NULL). ## 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 Box2D surface (#2877) lands as a single coherent docs update once the GeoParquet writer (#2886) is in. -- 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]
