[UDF] support RPC udaf part 1: support create RPC udaf in fe (#8510)

This commit is contained in:
Zhengguo Yang
2022-04-21 17:38:58 +08:00
committed by GitHub
parent 2c2e06a5fe
commit ae680b4248
31 changed files with 1220 additions and 1067 deletions

View File

@ -79,6 +79,8 @@ CREATE [AGGREGATE] [ALIAS] FUNCTION function_name
> "prepare_fn": Function signature of the prepare function for finding the entry from the dynamic library. This option is optional for custom functions
>
> "close_fn": Function signature of the close function for finding the entry from the dynamic library. This option is optional for custom functions
> "type": Function type, RPC for remote udf, NATIVE for c++ native udf
This statement creates a custom function. Executing this command requires that the user have `ADMIN` privileges.
@ -138,6 +140,13 @@ If the `function_name` contains the database name, the custom function will be c
CREATE ALIAS FUNCTION string(ALL, INT) WITH PARAMETER(col, length)
AS CAST(col AS varchar(length));
```
6. Create a remote UDF
```
CREATE FUNCTION rpc_add(INT, INT) RETURNS INT PROPERTIES (
"SYMBOL"="add_int",
"OBJECT_FILE"="127.0.0.1:9999",
"TYPE"="RPC"
);
```
## keyword
CREATE,FUNCTION