-
Notifications
You must be signed in to change notification settings - Fork 744
[GH-2547] Support *_Agg alias for *_Aggr functions #2564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR standardizes aggregate geometry function naming by introducing _Agg aliases to replace the existing _Aggr suffix across Flink, Spark, and Snowflake implementations. The original _Aggr functions remain available but are deprecated to maintain backward compatibility.
Key changes:
- Added
ST_Envelope_Agg,ST_Intersection_Agg, andST_Union_Aggas aliases for their_Aggrcounterparts - Updated documentation to use the new
_Aggnaming convention with deprecation notices - Added comprehensive test coverage for the new aliases across all platforms
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/expressions/st_aggregates.scala | Added Scala DataFrame API aliases for the three aggregate functions |
| spark/common/src/main/scala/org/apache/sedona/sql/UDF/AbstractCatalog.scala | Registered _Agg aliases in Spark's function registry with proper cleanup |
| spark/common/src/test/scala/org/apache/sedona/sql/dataFrameAPITestScala.scala | Added DataFrame API tests validating the new aliases |
| spark/common/src/test/scala/org/apache/sedona/sql/aggregateFunctionTestScala.scala | Added SQL tests verifying alias behavior |
| snowflake/src/main/java/org/apache/sedona/snowflake/snowsql/udtfs/*.java | Implemented three new UDTF classes for Snowflake aggregate functions |
| snowflake/src/main/java/org/apache/sedona/snowflake/snowsql/ddl/UDTFDDLGenerator.java | Registered new Snowflake UDTF classes |
| snowflake-tester/src/test/java/org/apache/sedona/snowflake/snowsql/TestTableFunctions.java | Added Snowflake-specific tests for the new functions |
| python/sedona/spark/sql/st_aggregates.py | Added Python wrapper functions with documentation |
| python/tests/sql/test_dataframe_api.py | Added Python DataFrame API test configurations |
| python/tests/sql/test_aggregate_functions.py | Added Python SQL tests for the aliases |
| flink/src/main/java/org/apache/sedona/flink/expressions/Aggregators.java | Implemented Flink aggregator classes extending the _Aggr versions |
| flink/src/main/java/org/apache/sedona/flink/Catalog.java | Registered Flink aggregator aliases |
| flink/src/test/java/org/apache/sedona/flink/AggregatorTest.java | Added Flink tests for the alias functions |
| docs/api/sql/AggregateFunction.md | Updated main SQL documentation to use _Agg naming |
| docs/api/snowflake/vector-data/AggregateFunction.md | Updated Snowflake documentation with new names and examples |
| docs/api/flink/Aggregator.md | Updated Flink documentation with new names and examples |
| common/src/test/java/org/apache/sedona/common/FunctionsTest.java | Fixed unrelated test assertion method |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Did you read the Contributor Guide?
Is this PR related to a ticket?
[GH-2547] my subject. Closing Support *_Agg alias for *_Aggr functions #2547What changes were proposed in this PR?
This pull request standardizes aggregate geometry function names by introducing _Agg aliases to replace _Aggr across Flink Spark and Snowflake. The original _Aggr functions are deprecated but remain available to preserve existing usage. Documentation and tests are updated to reflect and validate the new aliases.
Summary of changes
• Added _Agg aliases for ST_Envelope, ST_Intersection, and ST_Union across Flink Snowflake and Spark Python wrappers
• Marked _Aggr variants as deprecated while keeping them functional
• Updated SQL Flink and Snowflake docs to use _Agg and refreshed all examples
• Added Java and Python tests to ensure identical behavior between _Agg and _Aggr
• Cleaned up remaining documentation references for consistency
These updates improve API consistency and usability while maintaining compatibility with existing code.
How was this patch tested?
Passed existing unit tests and added new test cases
Did this PR include necessary documentation updates?