forked from apache/spark
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-48479][SQL] Support creating scalar and table SQL UDFs in parser
### What changes were proposed in this pull request? This PR adds support for creating user-defined SQL functions in parser. Here is the SQL syntax: ``` CREATE [OR REPLACE] [TEMPORARY] FUNCTION [IF NOT EXISTS] [db_name.]function_name ([param_name param_type [COMMENT param_comment], ...]) RETURNS {ret_type | TABLE (ret_name ret_type [COMMENT ret_comment], ...])} [function_properties] function_body; function_properties: [NOT] DETERMINISTIC | COMMENT function_comment | [ CONTAINS SQL | READS SQL DATA ] function_body: RETURN {expression | TABLE ( query )} ``` ### Why are the changes needed? To support SQL user-defined functions. ### Does this PR introduce _any_ user-facing change? Yes. This PR adds parser support for creating user-defined SQL functions. ### How was this patch tested? New unit tests. ### Was this patch authored or co-authored using generative AI tooling? No Closes apache#46816 from allisonwang-db/spark-48479-sql-udf-parser. Authored-by: allisonwang-db <[email protected]> Signed-off-by: Wenchen Fan <[email protected]>
- Loading branch information
1 parent
9eadb2c
commit 0d9f8a1
Showing
13 changed files
with
545 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.