jiayuasu opened a new pull request, #2878: URL: https://github.com/apache/sedona/pull/2878
## Summary Adds the `Box2D` value type and its UDT, the foundation for the bbox work tracked in #2877. Functions (`ST_Box2D`, `ST_MakeBox2D`, `ST_Extent`, accessor overloads, casts) follow in subsequent PRs. - `common/.../geometryObjects/Box2D.java` — planar 2D bounding box. Empty boxes encoded as `xmin > xmax` (JTS `Envelope` convention), making union/expand a no-op against empty. - `spark/common/.../UDT/Box2DUDT.scala` — struct-backed UDT with `sqlType = struct<xmin, ymin, xmax, ymax>` (all `double`, non-nullable). Struct-backed (not binary-backed) so values round-trip natively to Parquet and align zero-copy with GeoParquet 1.1 bbox covering columns. - `spark/common/.../UDT/UdtRegistratorWrapper.scala` — register `Box2D ↔ Box2DUDT`. Field names (`xmin/ymin/xmax/ymax`) match the GeoParquet 1.1 spec and `apache/sedona-db`'s GeoParquet writer for direct cross-engine interop. ## Test plan - [ ] CI builds the `common` and `spark/common` modules cleanly (the value class is plain Java; the UDT mirrors `GeographyUDT` except for `sqlType` and serde, and is exercised by registration during Spark session init). - [ ] Round-trip a `Box2D` literal through a Spark DataFrame and back — verify struct schema and value equality. (Test arrives with the function PR that creates literals through `ST_Box2D`/`ST_MakeBox2D`.) - [ ] Confirm `UDTRegistration.exists(classOf[Box2D].getName)` returns true after `UdtRegistratorWrapper.registerAll()`. -- 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]
