[enhancement] Function(create/drop) support the global operation (#16973) (#17608)

Support create/drop global function. 
     When you create a custom function, it can only be used within in one database. It cannot be used in other database/catalog. When there are many databases/catalog, it needs to create function one by one.

## Problem summary

Describe your changes.
1、 When a function is created or deleted, add the global keyword.

CREATE [GLOBAL] [AGGREGATE] [ALIAS] FUNCTION function_name (arg_type [, ...]) [RETURNS ret_type] [INTERMEDIATE inter_type] [WITH PARAMETER(param [,...]) AS origin_function] [PROPERTIES ("key" = "value" [, ...]) ]

DROP [GLOBAL] FUNCTION function_name (arg_type [, ...])

2、A completely global global function is set, and the global function metadata is stored in the image. The function lookup strategy is to look in the database first, and if it can't be found, it looks in the global function.
Co-authored-by: lexluo <lexluo@tencent.com>
This commit is contained in:
lexluo09
2023-03-18 22:06:48 +08:00
committed by GitHub
parent 49a053b3da
commit c95eb8a67f
23 changed files with 677 additions and 167 deletions

View File

@ -29,8 +29,8 @@ import java.io.IOException;
* Class A implements Writable {
* @Override
* public void write(DataOutput out) throws IOException {
* in.write(x);
* in.write(y);
* out.write(x);
* out.write(y);
* ...
* }
*