Sub-task of #2877.
Scope
Add the ST_Box2D(geom) -> Box2D scalar function. PostGIS calls this Box2D(geometry); we use the ST_ prefix for consistency with the rest of the Sedona surface.
Returns the planar bounding box of the input geometry, or SQL NULL for null/empty input (PostGIS-compatible). Backed by Box2D.fromGeometry(Geometry) (already merged in #2878).
Implementation
- New
ST_Box2D case class in spark/common/.../expressions/Functions.scala extending InferredExpression.
- Add
Box2D mappings in InferredExpression.scala (InferrableType[Box2D] instance, output serializer that turns a Box2D into a struct InternalRow, and Box2DUDT in the Spark return-type mapping).
- Register the function in
spark/common/.../UDF/Catalog.scala.
- Test coverage: scalar over point/linestring/polygon, null input, empty geometry input, schema check.
Out of scope
ST_MakeBox2D, ST_Extent, accessor overloads, casts — separate child issues under #2877.
Sub-task of #2877.
Scope
Add the
ST_Box2D(geom) -> Box2Dscalar function. PostGIS calls thisBox2D(geometry); we use theST_prefix for consistency with the rest of the Sedona surface.Returns the planar bounding box of the input geometry, or SQL NULL for null/empty input (PostGIS-compatible). Backed by
Box2D.fromGeometry(Geometry)(already merged in #2878).Implementation
ST_Box2Dcase class inspark/common/.../expressions/Functions.scalaextendingInferredExpression.Box2Dmappings inInferredExpression.scala(InferrableType[Box2D]instance, output serializer that turns aBox2Dinto a struct InternalRow, andBox2DUDTin the Spark return-type mapping).spark/common/.../UDF/Catalog.scala.Out of scope
ST_MakeBox2D,ST_Extent, accessor overloads, casts — separate child issues under #2877.