zhangfengcdt opened a new pull request, #2420: URL: https://github.com/apache/sedona/pull/2420
## 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 #<issue_number> ## What changes were proposed in this PR? Sedona functions are registered as temporary functions in the session `FunctionRegistry`, which prevents creating permanent VIEWs that reference them: ```sql CREATE VIEW my_view AS SELECT ST_AsText(geom) FROM buildings; ``` -- Error: Cannot create view that references temporary function: ST_AsText Spark's CreateViewCommand validates that permanent VIEWs cannot reference temporary functions. Since Sedona functions are only registered in the session registry (not the built-in registry), they are treated as temporary. This PR registers Sedona functions into Spark's built-in function registry (FunctionRegistry.builtin) in addition to the session registry. This makes Spark treat Sedona functions as built-in functions (similar to COUNT, MAX, SUM) rather than temporary functions, bypassing the CREATE VIEW validation. ## How was this patch tested? The new test validates: - Permanent VIEW creation with Sedona spatial functions - VIEW queries return correct results - Proper assertions instead of console output ## Did this PR include necessary documentation updates? - No, this PR does not affect any public API so no need to change the documentation. -- 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]
