jiayuasu opened a new pull request, #2895: URL: https://github.com/apache/sedona/pull/2895
## 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 #2882 ## What changes were proposed in this PR? Overloads the four 2D coordinate accessors (\`ST_XMin\`, \`ST_XMax\`, \`ST_YMin\`, \`ST_YMax\`) to accept a \`Box2D\` argument in addition to the existing \`Geometry\` argument. PostGIS-compatible. \`\`\`sql SELECT ST_XMin(ST_Box2D(geom)), ST_YMax(ST_Box2D(geom)) FROM ... \`\`\` - \`common/.../Functions.java\` — new \`xMin/xMax/yMin/yMax(Box2D)\` overloads (each is a NULL-safe field accessor). - \`spark/common/.../expressions/Functions.scala\` — the four \`ST_*\` case classes now extend \`InferredExpression\` with two overloaded function references (Geometry + Box2D). \`FunctionResolver\` picks the right backing function based on the input type at planning time. - \`spark/common/.../expressions/implicits.scala\` — \`toBox2D(input: InternalRow)\` extractor that handles the struct UDT representation. - \`spark/common/.../expressions/InferredExpression.scala\` — \`typeOf[Box2D]\` branch in \`buildArgumentExtractor\`. The output-side plumbing (\`InferrableType[Box2D]\`, struct serializer, Spark return-type mapping) was added in #2890. This PR adds the symmetrical input-side plumbing. Future Box2D-consuming functions (cast to geometry, \`ST_AsText\`, future predicates) plug in by reusing this scaffolding. ## How was this patch tested? \`functionTestScala\` (added \"Passed ST_XMin / XMax / YMin / YMax for Box2D\"): - Polygon → Box2D → all four accessors return the expected axis bounds. - NULL Box2D input → all four accessors return NULL. The existing Geometry-input tests continue to exercise the original overloads. ## Did this PR include necessary documentation updates? - No, this PR does not affect any public SQL API documentation surface in isolation. Documentation for the Box2D accessor overloads will land with the rest of the Phase 1 surface (#2877) in a single coherent docs update once \`ST_MakeBox2D\`, \`ST_Extent\`, and 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]
