jiayuasu opened a new pull request, #2862: URL: https://github.com/apache/sedona/pull/2862
## Did you read the Contributor Guide? - [x] Yes, I have read [Contributor Rules](https://sedona.apache.org/latest-snapshot/community/rule/) and [Contributor Development Guide](https://sedona.apache.org/latest-snapshot/community/develop/) before making this change ## What changes were proposed in this PR? Split the flat `Catalog.expressions` Seq into named category sequences whose names mirror the categories used by the public docs at https://sedona.apache.org/latest/api/sql/Geometry-Functions/ and the corresponding raster docs pages. Pure code reorganization — no behavior change, no new/removed functions, registration order preserved. Discussion in #2861. ### ST_ functions (17 named sequences matching docs) | val name | docs page | |----------|-----------| | `geometryConstructorExprs` | Geometry-Constructors | | `geometryAccessorExprs` | Geometry-Accessors | | `geometryEditorExprs` | Geometry-Editors | | `geometryOutputExprs` | Geometry-Output | | `predicateExprs` | Predicates | | `measurementExprs` | Measurement-Functions | | `geometryProcessingExprs` | Geometry-Processing | | `overlayExprs` | Overlay-Functions | | `affineTransformationExprs` | Affine-Transformations | | `linearReferencingExprs` | Linear-Referencing | | `spatialReferenceSystemExprs` | Spatial-Reference-System | | `geometryValidationExprs` | Geometry-Validation | | `boundingBoxExprs` | Bounding-Box-Functions | | `spatialIndexingExprs` | Spatial-Indexing (also receives `ST_KNN`) | | `addressExprs` | Address-Functions | | `clusteringExprs` | Clustering-Functions (registered via dbx incompat group) | | `spatialStatisticsExprs` | Spatial-Statistics (registered via dbx incompat group) | Plus `geographyExprs` for ST_Geog functions and a small `otherExprs` catch-all (currently just `Barrier`, which has no docs page). `ST_KNN` has its own `NearestNeighbourSearching.md` page but isn't listed under any of the 18 docs categories on `/api/sql/Geometry-Functions/`. It goes in `spatialIndexingExprs` since it's a nearest-neighbor helper. ### RS_ functions (10 named sequences matching raster docs) | val name | docs page | |----------|-----------| | `rasterConstructorExprs` | Raster-Constructors | | `rasterAccessorExprs` | Raster-Accessors | | `rasterBandAccessorExprs` | Raster-Band-Accessors | | `rasterOperatorExprs` | Raster-Operators | | `rasterOutputExprs` | Raster-Output | | `rasterPredicateExprs` | Raster-Predicates | | `rasterGeometryExprs` | Raster-Geometry-Functions | | `pixelExprs` | Pixel-Functions | | `mapAlgebraExprs` | Map-Algebra-Operators | | `rasterTileExprs` | Raster-Tiles | ### dbx-incompatible group split by docs category The current `geoStatsFunctions()` block is split into two categorized sub-sequences: - `ST_DBSCAN`, `ST_LocalOutlierFactor` → `clusteringExprs` (Clustering-Functions docs page) - `ST_GLocal`, `ST_BinaryDistanceBandColumn`, `ST_WeightedDistanceBandColumn` → `spatialStatisticsExprs` (Spatial-Statistics docs page) Both still wrapped in the same `try`/`catch` that returns empty sequences on unsupported DBR versions, so registration semantics are unchanged. ### CatalogCategorizationTest Added a test that enforces the invariant: every function in `Catalog.expressions` appears in exactly one named sequence. This catches function drops during refactoring — when I implemented this same proposal in an internal fork of an earlier Sedona version, the test caught three functions that had been added on master and silently dropped during the move. ### `aggregateExpressions` becomes `lazy val` Changed from `val` to `lazy val` so the categorization invariant test can access `Catalog.expressions` without bootstrapping Spark — the aggregator instances trigger encoder lookups via `SQLImplicits` that require Spark to be set up. No behavior change for production: `registerAll` is the only consumer and it runs after Spark is initialized. ## How was this patch tested? - New `CatalogCategorizationTest` passes (2/2 invariants) - Full `mvn clean install -DskipTests` builds across all Spark/Scala variants - Function list compared against `master` confirms exact equality (no drops, no additions) ## Did this PR include necessary documentation updates? - [x] No, this PR doesn't affect any documented behavior or API. -- 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]
