This is an automated email from the ASF dual-hosted git repository.

kassiez pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris-website.git


The following commit(s) were added to refs/heads/master by this push:
     new abed9df9447 [docs](sql-statement) Update CREATE FUNCTION (#2034)
abed9df9447 is described below

commit abed9df9447aa8883f3a8513ddd46123289d2206
Author: KassieZ <139741991+kass...@users.noreply.github.com>
AuthorDate: Thu Feb 13 12:31:20 2025 +0800

    [docs](sql-statement) Update CREATE FUNCTION (#2034)
    
    ## Versions
    
    - [ ] dev
    - [ ] 3.0
    - [ ] 2.1
    - [ ] 2.0
    
    ## Languages
    
    - [ ] Chinese
    - [ ] English
    
    ## Docs Checklist
    
    - [ ] Checked by AI
    - [ ] Test Cases Built
    
    ---------
    
    Co-authored-by: morrySnow <morrys...@126.com>
---
 .../sql-statements/function/CREATE-FUNCTION.md     | 139 ++++++++++++--------
 .../sql-statements/function/CREATE-FUNCTION.md     | 136 +++++++++++---------
 .../sql-statements/function/CREATE-FUNCTION.md     | 135 +++++++++++---------
 .../sql-statements/function/CREATE-FUNCTION.md     | 136 +++++++++++---------
 .../sql-statements/function/CREATE-FUNCTION.md     | 141 +++++++++++++--------
 .../sql-statements/function/CREATE-FUNCTION.md     | 139 ++++++++++++--------
 6 files changed, 482 insertions(+), 344 deletions(-)

diff --git a/docs/sql-manual/sql-statements/function/CREATE-FUNCTION.md 
b/docs/sql-manual/sql-statements/function/CREATE-FUNCTION.md
index a26270850ed..d13ade62f81 100644
--- a/docs/sql-manual/sql-statements/function/CREATE-FUNCTION.md
+++ b/docs/sql-manual/sql-statements/function/CREATE-FUNCTION.md
@@ -26,102 +26,131 @@ under the License.
 
 ## Description
 
-This statement creates a custom function. Executing this command requires the 
user to have `ADMIN` privileges.
+This statement is used to create a custom function.
 
-If `function_name` contains the database name, then the custom function will 
be created in the corresponding database, otherwise the function will be 
created in the database where the current session is located. The name and 
parameters of the new function cannot be the same as the existing functions in 
the current namespace, otherwise the creation will fail. But only with the same 
name and different parameters can be created successfully.
+## Syntax
 
-grammar:
 
 ```sql
-CREATE [GLOBAL] [AGGREGATE] [ALIAS] FUNCTION function_name
-    (arg_type [, ...])
-    [RETURNS ret_type]
-    [INTERMEDIATE inter_type]
-    [WITH PARAMETER(param [,...]) AS origin_function]
-    [PROPERTIES ("key" = "value" [, ...]) ]
+CREATE [ GLOBAL ] 
+    [{AGGREGATE | TABLES | ALIAS }] FUNCTION <function_name>
+    (<arg_type> [, ...])
+    [ RETURNS <ret_type> ]
+    [ INTERMEDIATE <inter_type> ]
+    [ WITH PARAMETER(<param> [,...]) AS <origin_function> ]
+    [ PROPERTIES ("<key>" = "<value>" [, ...]) ]
 ```
 
-Parameter Description:
+## Required Parameters
 
-- `GLOBAL`: If there is this item, it means that the created function is a 
global function.
+**1. `<function_name>`**
 
-- `AGGREGATE`: If there is this item, it means that the created function is an 
aggregate function.
+> If `function_name` includes a database name, such as `db1.my_func`, the 
custom function will be created in the corresponding database. Otherwise, the 
function will be created in the database of the current session. The name and 
parameters of the new function must not be identical to an existing function in 
the current namespace; otherwise, the creation will fail.
 
+**2. `<arg_type>`**
 
-- `ALIAS`: If there is this item, it means that the created function is an 
alias function.
+> The input parameter type of the function. For variable-length parameters, 
use `, ...` to indicate them. If it is a variable-length type, the type of the 
variable-length parameters must be consistent with the type of the last 
non-variable-length parameter.
 
+**3. `<ret_type>`**
 
- If the above two items are absent, it means that the created function is a 
scalar function
+> The return parameter type of the function. This is a required parameter for 
creating a new function. If creating an alias for an existing function, this 
parameter is not necessary.
 
-- `function_name`: The name of the function to be created, which can include 
the name of the database. For example: `db1.my_func`.
+## Optional Parameters
 
+**1. `GLOBAL`**
 
-- `arg_type`: The parameter type of the function, which is the same as the 
type defined when creating the table. Variable-length parameters can be 
represented by `, ...`. If it is a variable-length type, the type of the 
variable-length parameter is the same as that of the last non-variable-length 
parameter.
+> If specified, the created function is effective globally.
 
-  **NOTE**: `ALIAS FUNCTION` does not support variable-length arguments and 
must have at least one argument.
+**2. `AGGREGATE`**
 
-- `ret_type`: Required for creating new functions. If you are aliasing an 
existing function, you do not need to fill in this parameter.
+> If specified, the created function is an aggregate function.
 
+**3. `TABLES`**
 
-- `inter_type`: The data type used to represent the intermediate stage of the 
aggregation function.
+> If specified, the created function is a table function.
 
+**4. `ALIAS`**
 
-- `param`: used to represent the parameter of the alias function, including at 
least one.
+> If specified, the created function is an alias function.
 
+> If none of the above parameters representing the function type is selected, 
it indicates that the created function is a scalar function.
 
-- `origin_function`: used to represent the original function corresponding to 
the alias function.
+**5. `<inter_type>`**
 
+> Used to indicate the data type during the intermediate stage of an aggregate 
function.
 
-- `properties`: Used to set function-related properties, the properties that 
can be set include:
+**6. `<param>`**
 
-    - `file`: Indicates the jar package containing the user UDF. In a 
multi-machine environment, you can also use http to download the jar package. 
This parameter is mandatory.
+> Used to indicate the parameters of an alias function, with at least one 
parameter required.
 
-    - `symbol`: Indicates the name of the class containing the UDF class. This 
parameter must be set
+**7. `<origin_function>`**
 
-    - `type`: Indicates the UDF call type, the default is Native, and JAVA_UDF 
is passed when using Java UDF.
+> Used to indicate the original function corresponding to the alias function.
 
-    - `always_nullable`: Indicates whether NULL values may appear in the UDF 
return result, is an optional parameter, and the default value is true.
+**8. `<properties>`**
 
+> - `file`: Indicates the JAR package containing the user-defined function 
(UDF). In a multi-machine environment, it can also be downloaded via HTTP. This 
parameter is mandatory.
+> - `symbol`: Indicates the class name containing the UDF class. This 
parameter is mandatory.
+> - `type`: Indicates the UDF call type. The default is Native. Use JAVA_UDF 
when using a Java UDF.
+> - `always_nullable`: Indicates whether the UDF result may contain NULL 
values. This is an optional parameter with a default value of true.
+
+## Access Control Requirements
+
+To execute this command, the user must have `ADMIN_PRIV` privileges.
 
 ## Example
 
-1. Create a custom UDF function
+1. Create a custom UDF function. For more details, refer to 
[JAVA-UDF](../../../query-data/udf/java-user-defined-function).
+
+   
+
+   ```sql
+   CREATE FUNCTION java_udf_add_one(int) RETURNS int PROPERTIES (
+       "file"="file:///path/to/java-udf-demo-jar-with-dependencies.jar",
+       "symbol"="org.apache.doris.udf.AddOne",
+       "always_nullable"="true",
+       "type"="JAVA_UDF"
+   );
+   ```
+
+2. Create a custom UDAF function.
 
-    ```sql
-    CREATE FUNCTION java_udf_add_one(int) RETURNS int PROPERTIES (
-        "file"="file:///path/to/java-udf-demo-jar-with-dependencies.jar",
-        "symbol"="org.apache.doris.udf.AddOne",
-        "always_nullable"="true",
-        "type"="JAVA_UDF"
-    );
-    ```
+   
 
+   ```sql
+   CREATE AGGREGATE FUNCTION simple_sum(INT) RETURNS INT PROPERTIES (
+       "file"="file:///pathTo/java-udaf.jar",
+       "symbol"="org.apache.doris.udf.demo.SimpleDemo",
+       "always_nullable"="true",
+       "type"="JAVA_UDF"
+   );
+   ```
 
-2. Create a custom UDAF function
+3. Create a custom UDTF function.
 
-    ```sql
-    CREATE AGGREGATE FUNCTION simple_sum(INT) RETURNS INT PROPERTIES (
-        "file"="file:///pathTo/java-udaf.jar",
-        "symbol"="org.apache.doris.udf.demo.SimpleDemo",
-        "always_nullable"="true",
-        "type"="JAVA_UDF"
-    );
-    ```
+   
 
-3. Create a custom alias function
+   ```sql
+   CREATE TABLES FUNCTION java_udtf(string, string) RETURNS array<string> 
PROPERTIES (
+       "file"="file:///pathTo/java-udaf.jar",
+       "symbol"="org.apache.doris.udf.demo.UDTFStringTest",
+       "always_nullable"="true",
+       "type"="JAVA_UDF"
+   );
+   ```
 
-    ```sql
-    CREATE ALIAS FUNCTION id_masking(INT) WITH PARAMETER(id) AS 
CONCAT(LEFT(id, 3), '****', RIGHT(id, 4));
-    ```
+4. Create a custom alias function. For more information, refer to [Alias 
Function](../../../query-data/udf/alias-function).
 
-4. Create a global custom alias function
+   
 
-    ```sql
-    CREATE GLOBAL ALIAS FUNCTION id_masking(INT) WITH PARAMETER(id) AS 
CONCAT(LEFT(id, 3), '****', RIGHT(id, 4));
-    ```
+   ```sql
+   CREATE ALIAS FUNCTION id_masking(INT) WITH PARAMETER(id) AS CONCAT(LEFT(id, 
3), '****', RIGHT(id, 4));
+   ```
 
-## Keywords
+5. Create a global custom alias function.
 
-    CREATE, FUNCTION
+   
 
-## Best Practice
+   ```sql
+   CREATE GLOBAL ALIAS FUNCTION id_masking(INT) WITH PARAMETER(id) AS 
CONCAT(LEFT(id, 3), '****', RIGHT(id, 4));
+   ```
\ No newline at end of file
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/function/CREATE-FUNCTION.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/function/CREATE-FUNCTION.md
index ca83f4aa724..497dde47768 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/function/CREATE-FUNCTION.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/function/CREATE-FUNCTION.md
@@ -25,72 +25,85 @@ under the License.
 -->
 
 
-
-
 ## 描述
 
-此语句创建一个自定义函数。执行此命令需要用户拥有 `ADMIN` 权限。
-
-如果 `function_name` 
中包含了数据库名字,那么这个自定义函数会创建在对应的数据库中,否则这个函数将会创建在当前会话所在的数据库。新函数的名字与参数不能够与当前命名空间中已存在的函数相同,否则会创建失败。但是只有名字相同,参数不同是能够创建成功的。
+此语句用于创建一个自定义函数。
 
-语法:
+## 语法
 
 ```sql
-CREATE [GLOBAL] [AGGREGATE] [ALIAS] FUNCTION function_name
-    (arg_type [, ...])
-    [RETURNS ret_type]
-    [INTERMEDIATE inter_type]
-    [WITH PARAMETER(param [,...]) AS origin_function]
-    [PROPERTIES ("key" = "value" [, ...]) ]
+CREATE [ GLOBAL ] 
+    [{AGGREGATE | TABLES | ALIAS }] FUNCTION <function_name>
+    (<arg_type> [, ...])
+    [ RETURNS <ret_type> ]
+    [ INTERMEDIATE <inter_type> ]
+    [ WITH PARAMETER(<param> [,...]) AS <origin_function> ]
+    [ PROPERTIES ("<key>" = "<value>" [, ...]) ]
 ```
 
-参数说明:
+## 必选参数
+
+**1. `<function_name>`**
+
+> 如果 `function_name` 
中包含了数据库名字,比如:`db1.my_func`,那么这个自定义函数会创建在对应的数据库中,否则这个函数将会创建在当前会话所在的数据库。新函数的名字与参数不能够与当前命名空间中已存在的函数完全相同,否则会创建失败。
 
--  `GLOBAL`: 如果有此项,表示的是创建的函数是全局范围内生效。
+**2. `<arg_type>`**
 
--  `AGGREGATE`: 如果有此项,表示的是创建的函数是一个聚合函数。
+> 函数的输入参数类型。变长参数时可以使用`, ...`来表示,如果是变长类型,那么变长部分参数的类型与最后一个非变长参数类型一致。
 
+**3. `<ret_type>`**
 
--  `ALIAS`:如果有此项,表示的是创建的函数是一个别名函数。
+> 函数的返回参数类型,对创建新的函数来说,是必填项。如果是给已有函数取别名则可不用填写该参数。
 
+## 可选参数
 
-               如果没有上述两项,表示创建的函数是一个标量函数
+**1. `GLOBAL`**
 
--  `function_name`: 要创建函数的名字,可以包含数据库的名字。比如:`db1.my_func`。
+> 如果有此项,表示的是创建的函数是全局范围内生效。
 
+**2. `AGGREGATE`**
 
--  `arg_type`: 函数的参数类型,与建表时定义的类型一致。变长参数时可以使用`, 
...`来表示,如果是变长类型,那么变长部分参数的类型与最后一个非变长参数类型一致。
+> 如果有此项,表示的是创建的函数是一个聚合函数。
 
-   **注意**:`ALIAS FUNCTION` 不支持变长参数,且至少有一个参数。
+**3. `TABLES`**
 
--  `ret_type`: 对创建新的函数来说,是必填项。如果是给已有函数取别名则可不用填写该参数。
+> 如果有此项,表示的是创建的函数是一个表函数。
 
+**4. `ALIAS`**
 
--  `inter_type`: 用于表示聚合函数中间阶段的数据类型。
+> 如果有此项,表示的是创建的函数是一个别名函数。
 
+> 如果没有选择上述代表函数的参数,则表示创建的函数是一个标量函数
 
--  `param`:用于表示别名函数的参数,至少包含一个。
+**5. `<inter_type>`**
 
+> 用于表示聚合函数中间阶段的数据类型。
 
--  `origin_function`:用于表示别名函数对应的原始函数。
+**6. `<param>`**
 
-- `properties`: 用于设定函数相关属性,能够设置的属性包括:  
+> 用于表示别名函数的参数,至少包含一个。
 
-  - `file`: 表示的包含用户 UDF 的 jar 包,当在多机环境时,也可以使用 http 的方式下载 jar 包。这个参数是必须设定的。
+**7. `<origin_function>`**
 
-  - `symbol`: 表示的是包含 UDF 类的类名。这个参数是必须设定的
+> 用于表示别名函数对应的原始函数。
 
-  - `type`: 表示的 UDF 调用类型,默认为 Native,使用 Java UDF 时传 JAVA_UDF。
+**8. `<properties>`**
 
-  - `always_nullable`:表示的 UDF 返回结果中是否有可能出现 NULL 值,是可选参数,默认值为 true。
+> - `file`: 表示的包含用户 UDF 的 jar 包,当在多机环境时,也可以使用 http 的方式下载 jar 包。这个参数是必须设定的。
+> - `symbol`: 表示的是包含 UDF 类的类名。这个参数是必须设定的
+> - `type`: 表示的 UDF 调用类型,默认为 Native,使用 Java UDF 时传 JAVA_UDF。
+> - `always_nullable`:表示的 UDF 返回结果中是否有可能出现 NULL 值,是可选参数,默认值为 true。
 
+## 权限控制
+
+执行此命令需要用户拥有 `ADMIN_PRIV` 权限。
 
 ## 示例
 
-1. 创建一个自定义 UDF 函数
+1. 创建一个自定义 UDF 
函数,更多详细信息可以查看[JAVA-UDF](../../../query-data/udf/java-user-defined-function)
 
-   ```sql
-   CREATE FUNCTION java_udf_add_one(int) RETURNS int PROPERTIES (
+    ```sql
+    CREATE FUNCTION java_udf_add_one(int) RETURNS int PROPERTIES (
        "file"="file:///path/to/java-udf-demo-jar-with-dependencies.jar",
        "symbol"="org.apache.doris.udf.AddOne",
        "always_nullable"="true",
@@ -98,33 +111,36 @@ CREATE [GLOBAL] [AGGREGATE] [ALIAS] FUNCTION function_name
    );
    ```
 
-
 2. 创建一个自定义 UDAF 函数
 
-   ```sql
-   CREATE AGGREGATE FUNCTION simple_sum(INT) RETURNS INT PROPERTIES (
-       "file"="file:///pathTo/java-udaf.jar",
-       "symbol"="org.apache.doris.udf.demo.SimpleDemo",
-       "always_nullable"="true",
-       "type"="JAVA_UDF"
-   );
-   ```
-
-3. 创建一个自定义别名函数
-
-   ```sql
-   CREATE ALIAS FUNCTION id_masking(INT) WITH PARAMETER(id)  AS 
CONCAT(LEFT(id, 3), '****', RIGHT(id, 4));
-   ```
-
-4. 创建一个全局自定义别名函数
-
-   ```sql
-   CREATE GLOBAL ALIAS FUNCTION id_masking(INT) WITH PARAMETER(id) AS 
CONCAT(LEFT(id, 3), '****', RIGHT(id, 4));
-   ``` 
-   
-## 关键词
-
-    CREATE, FUNCTION
-
-### 最佳实践
-
+    ```sql
+    CREATE AGGREGATE FUNCTION simple_sum(INT) RETURNS INT PROPERTIES (
+        "file"="file:///pathTo/java-udaf.jar",
+        "symbol"="org.apache.doris.udf.demo.SimpleDemo",
+        "always_nullable"="true",
+        "type"="JAVA_UDF"
+    );
+    ```
+
+3. 创建一个自定义 UDTF 函数
+
+    ```sql
+    CREATE TABLES FUNCTION java-utdf(string, string) RETURNS array<string> 
PROPERTIES (
+        "file"="file:///pathTo/java-udaf.jar",
+        "symbol"="org.apache.doris.udf.demo.UDTFStringTest",
+        "always_nullable"="true",
+        "type"="JAVA_UDF"
+    );
+    ```
+
+4. 创建一个自定义别名函数,更多信息可以查看[别名函数](../../../query-data/udf/alias-function)
+
+    ```sql
+    CREATE ALIAS FUNCTION id_masking(INT) WITH PARAMETER(id) AS 
CONCAT(LEFT(id, 3), '****', RIGHT(id, 4));
+    ```
+
+5. 创建一个全局自定义别名函数
+
+    ```sql
+    CREATE GLOBAL ALIAS FUNCTION id_masking(INT) WITH PARAMETER(id) AS 
CONCAT(LEFT(id, 3), '****', RIGHT(id, 4));
+    ```
\ No newline at end of file
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/function/CREATE-FUNCTION.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/function/CREATE-FUNCTION.md
index 4ed21dec6de..d05ae59ea72 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/function/CREATE-FUNCTION.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/function/CREATE-FUNCTION.md
@@ -28,67 +28,82 @@ under the License.
 
 ## 描述
 
-此语句创建一个自定义函数。执行此命令需要用户拥有 `ADMIN` 权限。
+此语句用于创建一个自定义函数。
 
-如果 `function_name` 
中包含了数据库名字,那么这个自定义函数会创建在对应的数据库中,否则这个函数将会创建在当前会话所在的数据库。新函数的名字与参数不能够与当前命名空间中已存在的函数相同,否则会创建失败。但是只有名字相同,参数不同是能够创建成功的。
-
-语法:
+## 语法
 
 ```sql
-CREATE [GLOBAL] [AGGREGATE] [ALIAS] FUNCTION function_name
-    (arg_type [, ...])
-    [RETURNS ret_type]
-    [INTERMEDIATE inter_type]
-    [WITH PARAMETER(param [,...]) AS origin_function]
-    [PROPERTIES ("key" = "value" [, ...]) ]
+CREATE [ GLOBAL ] 
+    [{AGGREGATE | TABLES | ALIAS }] FUNCTION <function_name>
+    (<arg_type> [, ...])
+    [ RETURNS <ret_type> ]
+    [ INTERMEDIATE <inter_type> ]
+    [ WITH PARAMETER(<param> [,...]) AS <origin_function> ]
+    [ PROPERTIES ("<key>" = "<value>" [, ...]) ]
 ```
+## 必选参数
 
-参数说明:
+**1. `<function_name>`**
 
--  `GLOBAL`: 如果有此项,表示的是创建的函数是全局范围内生效。
+> 如果 `function_name` 
中包含了数据库名字,比如:`db1.my_func`,那么这个自定义函数会创建在对应的数据库中,否则这个函数将会创建在当前会话所在的数据库。新函数的名字与参数不能够与当前命名空间中已存在的函数完全相同,否则会创建失败。
 
--  `AGGREGATE`: 如果有此项,表示的是创建的函数是一个聚合函数。
+**2. `<arg_type>`**
 
--  `ALIAS`:如果有此项,表示的是创建的函数是一个别名函数。
-               如果没有上述两项,表示创建的函数是一个标量函数
+> 函数的输入参数类型。变长参数时可以使用`, ...`来表示,如果是变长类型,那么变长部分参数的类型与最后一个非变长参数类型一致。
 
--  `function_name`: 要创建函数的名字,可以包含数据库的名字。比如:`db1.my_func`。
+**3. `<ret_type>`**
 
+> 函数的返回参数类型,对创建新的函数来说,是必填项。如果是给已有函数取别名则可不用填写该参数。
 
+## 可选参数
 
--  `arg_type`: 函数的参数类型,与建表时定义的类型一致。变长参数时可以使用`, 
...`来表示,如果是变长类型,那么变长部分参数的类型与最后一个非变长参数类型一致。
+**1. `GLOBAL`**
 
-   **注意**:`ALIAS FUNCTION` 不支持变长参数,且至少有一个参数。
+> 如果有此项,表示的是创建的函数是全局范围内生效。
 
--  `ret_type`: 对创建新的函数来说,是必填项。如果是给已有函数取别名则可不用填写该参数。
+**2. `AGGREGATE`**
 
+> 如果有此项,表示的是创建的函数是一个聚合函数。
 
--  `inter_type`: 用于表示聚合函数中间阶段的数据类型。
+**3. `TABLES`**
 
+> 如果有此项,表示的是创建的函数是一个表函数。
 
--  `param`:用于表示别名函数的参数,至少包含一个。
+**4. `ALIAS`**
 
+> 如果有此项,表示的是创建的函数是一个别名函数。
 
--  `origin_function`:用于表示别名函数对应的原始函数。
+> 如果没有选择上述代表函数的参数,则表示创建的函数是一个标量函数
 
-- `properties`: 用于设定函数相关属性,能够设置的属性包括:  
+**5. `<inter_type>`**
 
-  - `file`: 表示的包含用户 UDF 的 jar 包,当在多机环境时,也可以使用 http 的方式下载 jar 包。这个参数是必须设定的。
+> 用于表示聚合函数中间阶段的数据类型。
 
-  - `symbol`: 表示的是包含 UDF 类的类名。这个参数是必须设定的
+**6. `<param>`**
 
-  - `type`: 表示的 UDF 调用类型,默认为 Native,使用 Java UDF 时传 JAVA_UDF。
+> 用于表示别名函数的参数,至少包含一个。
 
-  - `always_nullable`:表示的 UDF 返回结果中是否有可能出现 NULL 值,是可选参数,默认值为 true。
+**7. `<origin_function>`**
 
-## 示例
+> 用于表示别名函数对应的原始函数。
+
+**8. `<properties>`**
 
+> - `file`: 表示的包含用户 UDF 的 jar 包,当在多机环境时,也可以使用 http 的方式下载 jar 包。这个参数是必须设定的。
+> - `symbol`: 表示的是包含 UDF 类的类名。这个参数是必须设定的
+> - `type`: 表示的 UDF 调用类型,默认为 Native,使用 Java UDF 时传 JAVA_UDF。
+> - `always_nullable`:表示的 UDF 返回结果中是否有可能出现 NULL 值,是可选参数,默认值为 true。
 
-1. 创建一个自定义 UDF 函数
+## 权限控制
 
+执行此命令需要用户拥有 `ADMIN_PRIV` 权限。
+
+## 示例
 
-   ```sql
-   CREATE FUNCTION java_udf_add_one(int) RETURNS int PROPERTIES (
+1. 创建一个自定义 UDF 
函数,更多详细信息可以查看[JAVA-UDF](../../../query-data/udf/java-user-defined-function)
+
+    ```sql
+    CREATE FUNCTION java_udf_add_one(int) RETURNS int PROPERTIES (
        "file"="file:///path/to/java-udf-demo-jar-with-dependencies.jar",
        "symbol"="org.apache.doris.udf.AddOne",
        "always_nullable"="true",
@@ -98,30 +113,34 @@ CREATE [GLOBAL] [AGGREGATE] [ALIAS] FUNCTION function_name
 
 2. 创建一个自定义 UDAF 函数
 
-   ```sql
-   CREATE AGGREGATE FUNCTION simple_sum(INT) RETURNS INT PROPERTIES (
-       "file"="file:///pathTo/java-udaf.jar",
-       "symbol"="org.apache.doris.udf.demo.SimpleDemo",
-       "always_nullable"="true",
-       "type"="JAVA_UDF"
-   );
-   ```
-
-3. 创建一个自定义别名函数
-
-   ```sql
-   CREATE ALIAS FUNCTION id_masking(INT) WITH PARAMETER(id)  AS 
CONCAT(LEFT(id, 3), '****', RIGHT(id, 4));
-   ```
-
-4. 创建一个全局自定义别名函数
-
-   ```sql
-   CREATE GLOBAL ALIAS FUNCTION id_masking(INT) WITH PARAMETER(id) AS 
CONCAT(LEFT(id, 3), '****', RIGHT(id, 4));
-   ``` 
-   
-## 关键词
-
-    CREATE, FUNCTION
-
-## 最佳实践
-
+    ```sql
+    CREATE AGGREGATE FUNCTION simple_sum(INT) RETURNS INT PROPERTIES (
+        "file"="file:///pathTo/java-udaf.jar",
+        "symbol"="org.apache.doris.udf.demo.SimpleDemo",
+        "always_nullable"="true",
+        "type"="JAVA_UDF"
+    );
+    ```
+
+3. 创建一个自定义 UDTF 函数
+
+    ```sql
+    CREATE TABLES FUNCTION java-utdf(string, string) RETURNS array<string> 
PROPERTIES (
+        "file"="file:///pathTo/java-udaf.jar",
+        "symbol"="org.apache.doris.udf.demo.UDTFStringTest",
+        "always_nullable"="true",
+        "type"="JAVA_UDF"
+    );
+    ```
+
+4. 创建一个自定义别名函数,更多信息可以查看[别名函数](../../../query-data/udf/alias-function)
+
+    ```sql
+    CREATE ALIAS FUNCTION id_masking(INT) WITH PARAMETER(id) AS 
CONCAT(LEFT(id, 3), '****', RIGHT(id, 4));
+    ```
+
+5. 创建一个全局自定义别名函数
+
+    ```sql
+    CREATE GLOBAL ALIAS FUNCTION id_masking(INT) WITH PARAMETER(id) AS 
CONCAT(LEFT(id, 3), '****', RIGHT(id, 4));
+    ```
\ No newline at end of file
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/function/CREATE-FUNCTION.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/function/CREATE-FUNCTION.md
index ca83f4aa724..497dde47768 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/function/CREATE-FUNCTION.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/function/CREATE-FUNCTION.md
@@ -25,72 +25,85 @@ under the License.
 -->
 
 
-
-
 ## 描述
 
-此语句创建一个自定义函数。执行此命令需要用户拥有 `ADMIN` 权限。
-
-如果 `function_name` 
中包含了数据库名字,那么这个自定义函数会创建在对应的数据库中,否则这个函数将会创建在当前会话所在的数据库。新函数的名字与参数不能够与当前命名空间中已存在的函数相同,否则会创建失败。但是只有名字相同,参数不同是能够创建成功的。
+此语句用于创建一个自定义函数。
 
-语法:
+## 语法
 
 ```sql
-CREATE [GLOBAL] [AGGREGATE] [ALIAS] FUNCTION function_name
-    (arg_type [, ...])
-    [RETURNS ret_type]
-    [INTERMEDIATE inter_type]
-    [WITH PARAMETER(param [,...]) AS origin_function]
-    [PROPERTIES ("key" = "value" [, ...]) ]
+CREATE [ GLOBAL ] 
+    [{AGGREGATE | TABLES | ALIAS }] FUNCTION <function_name>
+    (<arg_type> [, ...])
+    [ RETURNS <ret_type> ]
+    [ INTERMEDIATE <inter_type> ]
+    [ WITH PARAMETER(<param> [,...]) AS <origin_function> ]
+    [ PROPERTIES ("<key>" = "<value>" [, ...]) ]
 ```
 
-参数说明:
+## 必选参数
+
+**1. `<function_name>`**
+
+> 如果 `function_name` 
中包含了数据库名字,比如:`db1.my_func`,那么这个自定义函数会创建在对应的数据库中,否则这个函数将会创建在当前会话所在的数据库。新函数的名字与参数不能够与当前命名空间中已存在的函数完全相同,否则会创建失败。
 
--  `GLOBAL`: 如果有此项,表示的是创建的函数是全局范围内生效。
+**2. `<arg_type>`**
 
--  `AGGREGATE`: 如果有此项,表示的是创建的函数是一个聚合函数。
+> 函数的输入参数类型。变长参数时可以使用`, ...`来表示,如果是变长类型,那么变长部分参数的类型与最后一个非变长参数类型一致。
 
+**3. `<ret_type>`**
 
--  `ALIAS`:如果有此项,表示的是创建的函数是一个别名函数。
+> 函数的返回参数类型,对创建新的函数来说,是必填项。如果是给已有函数取别名则可不用填写该参数。
 
+## 可选参数
 
-               如果没有上述两项,表示创建的函数是一个标量函数
+**1. `GLOBAL`**
 
--  `function_name`: 要创建函数的名字,可以包含数据库的名字。比如:`db1.my_func`。
+> 如果有此项,表示的是创建的函数是全局范围内生效。
 
+**2. `AGGREGATE`**
 
--  `arg_type`: 函数的参数类型,与建表时定义的类型一致。变长参数时可以使用`, 
...`来表示,如果是变长类型,那么变长部分参数的类型与最后一个非变长参数类型一致。
+> 如果有此项,表示的是创建的函数是一个聚合函数。
 
-   **注意**:`ALIAS FUNCTION` 不支持变长参数,且至少有一个参数。
+**3. `TABLES`**
 
--  `ret_type`: 对创建新的函数来说,是必填项。如果是给已有函数取别名则可不用填写该参数。
+> 如果有此项,表示的是创建的函数是一个表函数。
 
+**4. `ALIAS`**
 
--  `inter_type`: 用于表示聚合函数中间阶段的数据类型。
+> 如果有此项,表示的是创建的函数是一个别名函数。
 
+> 如果没有选择上述代表函数的参数,则表示创建的函数是一个标量函数
 
--  `param`:用于表示别名函数的参数,至少包含一个。
+**5. `<inter_type>`**
 
+> 用于表示聚合函数中间阶段的数据类型。
 
--  `origin_function`:用于表示别名函数对应的原始函数。
+**6. `<param>`**
 
-- `properties`: 用于设定函数相关属性,能够设置的属性包括:  
+> 用于表示别名函数的参数,至少包含一个。
 
-  - `file`: 表示的包含用户 UDF 的 jar 包,当在多机环境时,也可以使用 http 的方式下载 jar 包。这个参数是必须设定的。
+**7. `<origin_function>`**
 
-  - `symbol`: 表示的是包含 UDF 类的类名。这个参数是必须设定的
+> 用于表示别名函数对应的原始函数。
 
-  - `type`: 表示的 UDF 调用类型,默认为 Native,使用 Java UDF 时传 JAVA_UDF。
+**8. `<properties>`**
 
-  - `always_nullable`:表示的 UDF 返回结果中是否有可能出现 NULL 值,是可选参数,默认值为 true。
+> - `file`: 表示的包含用户 UDF 的 jar 包,当在多机环境时,也可以使用 http 的方式下载 jar 包。这个参数是必须设定的。
+> - `symbol`: 表示的是包含 UDF 类的类名。这个参数是必须设定的
+> - `type`: 表示的 UDF 调用类型,默认为 Native,使用 Java UDF 时传 JAVA_UDF。
+> - `always_nullable`:表示的 UDF 返回结果中是否有可能出现 NULL 值,是可选参数,默认值为 true。
 
+## 权限控制
+
+执行此命令需要用户拥有 `ADMIN_PRIV` 权限。
 
 ## 示例
 
-1. 创建一个自定义 UDF 函数
+1. 创建一个自定义 UDF 
函数,更多详细信息可以查看[JAVA-UDF](../../../query-data/udf/java-user-defined-function)
 
-   ```sql
-   CREATE FUNCTION java_udf_add_one(int) RETURNS int PROPERTIES (
+    ```sql
+    CREATE FUNCTION java_udf_add_one(int) RETURNS int PROPERTIES (
        "file"="file:///path/to/java-udf-demo-jar-with-dependencies.jar",
        "symbol"="org.apache.doris.udf.AddOne",
        "always_nullable"="true",
@@ -98,33 +111,36 @@ CREATE [GLOBAL] [AGGREGATE] [ALIAS] FUNCTION function_name
    );
    ```
 
-
 2. 创建一个自定义 UDAF 函数
 
-   ```sql
-   CREATE AGGREGATE FUNCTION simple_sum(INT) RETURNS INT PROPERTIES (
-       "file"="file:///pathTo/java-udaf.jar",
-       "symbol"="org.apache.doris.udf.demo.SimpleDemo",
-       "always_nullable"="true",
-       "type"="JAVA_UDF"
-   );
-   ```
-
-3. 创建一个自定义别名函数
-
-   ```sql
-   CREATE ALIAS FUNCTION id_masking(INT) WITH PARAMETER(id)  AS 
CONCAT(LEFT(id, 3), '****', RIGHT(id, 4));
-   ```
-
-4. 创建一个全局自定义别名函数
-
-   ```sql
-   CREATE GLOBAL ALIAS FUNCTION id_masking(INT) WITH PARAMETER(id) AS 
CONCAT(LEFT(id, 3), '****', RIGHT(id, 4));
-   ``` 
-   
-## 关键词
-
-    CREATE, FUNCTION
-
-### 最佳实践
-
+    ```sql
+    CREATE AGGREGATE FUNCTION simple_sum(INT) RETURNS INT PROPERTIES (
+        "file"="file:///pathTo/java-udaf.jar",
+        "symbol"="org.apache.doris.udf.demo.SimpleDemo",
+        "always_nullable"="true",
+        "type"="JAVA_UDF"
+    );
+    ```
+
+3. 创建一个自定义 UDTF 函数
+
+    ```sql
+    CREATE TABLES FUNCTION java-utdf(string, string) RETURNS array<string> 
PROPERTIES (
+        "file"="file:///pathTo/java-udaf.jar",
+        "symbol"="org.apache.doris.udf.demo.UDTFStringTest",
+        "always_nullable"="true",
+        "type"="JAVA_UDF"
+    );
+    ```
+
+4. 创建一个自定义别名函数,更多信息可以查看[别名函数](../../../query-data/udf/alias-function)
+
+    ```sql
+    CREATE ALIAS FUNCTION id_masking(INT) WITH PARAMETER(id) AS 
CONCAT(LEFT(id, 3), '****', RIGHT(id, 4));
+    ```
+
+5. 创建一个全局自定义别名函数
+
+    ```sql
+    CREATE GLOBAL ALIAS FUNCTION id_masking(INT) WITH PARAMETER(id) AS 
CONCAT(LEFT(id, 3), '****', RIGHT(id, 4));
+    ```
\ No newline at end of file
diff --git 
a/versioned_docs/version-2.1/sql-manual/sql-statements/function/CREATE-FUNCTION.md
 
b/versioned_docs/version-2.1/sql-manual/sql-statements/function/CREATE-FUNCTION.md
index b25c137f70e..014ab900f9c 100644
--- 
a/versioned_docs/version-2.1/sql-manual/sql-statements/function/CREATE-FUNCTION.md
+++ 
b/versioned_docs/version-2.1/sql-manual/sql-statements/function/CREATE-FUNCTION.md
@@ -28,102 +28,131 @@ under the License.
 
 ## Description
 
-This statement creates a custom function. Executing this command requires the 
user to have `ADMIN` privileges.
+This statement is used to create a custom function.
 
-If `function_name` contains the database name, then the custom function will 
be created in the corresponding database, otherwise the function will be 
created in the database where the current session is located. The name and 
parameters of the new function cannot be the same as the existing functions in 
the current namespace, otherwise the creation will fail. But only with the same 
name and different parameters can be created successfully.
+## Syntax
 
-grammar:
 
 ```sql
-CREATE [GLOBAL] [AGGREGATE] [ALIAS] FUNCTION function_name
-    (arg_type [, ...])
-    [RETURNS ret_type]
-    [INTERMEDIATE inter_type]
-    [WITH PARAMETER(param [,...]) AS origin_function]
-    [PROPERTIES ("key" = "value" [, ...]) ]
+CREATE [ GLOBAL ] 
+    [{AGGREGATE | TABLES | ALIAS }] FUNCTION <function_name>
+    (<arg_type> [, ...])
+    [ RETURNS <ret_type> ]
+    [ INTERMEDIATE <inter_type> ]
+    [ WITH PARAMETER(<param> [,...]) AS <origin_function> ]
+    [ PROPERTIES ("<key>" = "<value>" [, ...]) ]
 ```
 
-Parameter Description:
+## Required Parameters
 
-- `GLOBAL`: If there is this item, it means that the created function is a 
global function.
+**1. `<function_name>`**
 
-- `AGGREGATE`: If there is this item, it means that the created function is an 
aggregate function.
+> If `function_name` includes a database name, such as `db1.my_func`, the 
custom function will be created in the corresponding database. Otherwise, the 
function will be created in the database of the current session. The name and 
parameters of the new function must not be identical to an existing function in 
the current namespace; otherwise, the creation will fail.
 
+**2. `<arg_type>`**
 
-- `ALIAS`: If there is this item, it means that the created function is an 
alias function.
+> The input parameter type of the function. For variable-length parameters, 
use `, ...` to indicate them. If it is a variable-length type, the type of the 
variable-length parameters must be consistent with the type of the last 
non-variable-length parameter.
 
+**3. `<ret_type>`**
 
- If the above two items are absent, it means that the created function is a 
scalar function
+> The return parameter type of the function. This is a required parameter for 
creating a new function. If creating an alias for an existing function, this 
parameter is not necessary.
 
-- `function_name`: The name of the function to be created, which can include 
the name of the database. For example: `db1.my_func`.
+## Optional Parameters
 
+**1. `GLOBAL`**
 
-- `arg_type`: The parameter type of the function, which is the same as the 
type defined when creating the table. Variable-length parameters can be 
represented by `, ...`. If it is a variable-length type, the type of the 
variable-length parameter is the same as that of the last non-variable-length 
parameter.
+> If specified, the created function is effective globally.
 
-  **NOTE**: `ALIAS FUNCTION` does not support variable-length arguments and 
must have at least one argument.
+**2. `AGGREGATE`**
 
-- `ret_type`: Required for creating new functions. If you are aliasing an 
existing function, you do not need to fill in this parameter.
+> If specified, the created function is an aggregate function.
 
+**3. `TABLES`**
 
-- `inter_type`: The data type used to represent the intermediate stage of the 
aggregation function.
+> If specified, the created function is a table function.
 
+**4. `ALIAS`**
 
-- `param`: used to represent the parameter of the alias function, including at 
least one.
+> If specified, the created function is an alias function.
 
+> If none of the above parameters representing the function type is selected, 
it indicates that the created function is a scalar function.
 
-- `origin_function`: used to represent the original function corresponding to 
the alias function.
+**5. `<inter_type>`**
 
+> Used to indicate the data type during the intermediate stage of an aggregate 
function.
 
-- `properties`: Used to set function-related properties, the properties that 
can be set include:
+**6. `<param>`**
 
-    - `file`: Indicates the jar package containing the user UDF. In a 
multi-machine environment, you can also use http to download the jar package. 
This parameter is mandatory.
+> Used to indicate the parameters of an alias function, with at least one 
parameter required.
 
-    - `symbol`: Indicates the name of the class containing the UDF class. This 
parameter must be set
+**7. `<origin_function>`**
 
-    - `type`: Indicates the UDF call type, the default is Native, and JAVA_UDF 
is passed when using Java UDF.
+> Used to indicate the original function corresponding to the alias function.
 
-    - `always_nullable`: Indicates whether NULL values may appear in the UDF 
return result, is an optional parameter, and the default value is true.
+**8. `<properties>`**
 
+> - `file`: Indicates the JAR package containing the user-defined function 
(UDF). In a multi-machine environment, it can also be downloaded via HTTP. This 
parameter is mandatory.
+> - `symbol`: Indicates the class name containing the UDF class. This 
parameter is mandatory.
+> - `type`: Indicates the UDF call type. The default is Native. Use JAVA_UDF 
when using a Java UDF.
+> - `always_nullable`: Indicates whether the UDF result may contain NULL 
values. This is an optional parameter with a default value of true.
 
-## Examples
+## Access Control Requirements
 
-1. Create a custom UDF function
+To execute this command, the user must have `ADMIN_PRIV` privileges.
 
-    ```sql
-    CREATE FUNCTION java_udf_add_one(int) RETURNS int PROPERTIES (
-        "file"="file:///path/to/java-udf-demo-jar-with-dependencies.jar",
-        "symbol"="org.apache.doris.udf.AddOne",
-        "always_nullable"="true",
-        "type"="JAVA_UDF"
-    );
-    ```
+## Example
 
+1. Create a custom UDF function. For more details, refer to 
[JAVA-UDF](../../../query-data/udf/java-user-defined-function).
 
-2. Create a custom UDAF function
+   
 
-    ```sql
-    CREATE AGGREGATE FUNCTION simple_sum(INT) RETURNS INT PROPERTIES (
-        "file"="file:///pathTo/java-udaf.jar",
-        "symbol"="org.apache.doris.udf.demo.SimpleDemo",
-        "always_nullable"="true",
-        "type"="JAVA_UDF"
-    );
-    ```
+   ```sql
+   CREATE FUNCTION java_udf_add_one(int) RETURNS int PROPERTIES (
+       "file"="file:///path/to/java-udf-demo-jar-with-dependencies.jar",
+       "symbol"="org.apache.doris.udf.AddOne",
+       "always_nullable"="true",
+       "type"="JAVA_UDF"
+   );
+   ```
 
-3. Create a custom alias function
+2. Create a custom UDAF function.
 
-    ```sql
-    CREATE ALIAS FUNCTION id_masking(INT) WITH PARAMETER(id) AS 
CONCAT(LEFT(id, 3), '****', RIGHT(id, 4));
-    ```
+   
 
-4. Create a global custom alias function
+   ```sql
+   CREATE AGGREGATE FUNCTION simple_sum(INT) RETURNS INT PROPERTIES (
+       "file"="file:///pathTo/java-udaf.jar",
+       "symbol"="org.apache.doris.udf.demo.SimpleDemo",
+       "always_nullable"="true",
+       "type"="JAVA_UDF"
+   );
+   ```
 
-    ```sql
-    CREATE GLOBAL ALIAS FUNCTION id_masking(INT) WITH PARAMETER(id) AS 
CONCAT(LEFT(id, 3), '****', RIGHT(id, 4));
-    ```
+3. Create a custom UDTF function.
 
-## Keywords
+   
 
-    CREATE, FUNCTION
+   ```sql
+   CREATE TABLES FUNCTION java_udtf(string, string) RETURNS array<string> 
PROPERTIES (
+       "file"="file:///pathTo/java-udaf.jar",
+       "symbol"="org.apache.doris.udf.demo.UDTFStringTest",
+       "always_nullable"="true",
+       "type"="JAVA_UDF"
+   );
+   ```
 
-## Best Practice
+4. Create a custom alias function. For more information, refer to [Alias 
Function](../../../query-data/udf/alias-function).
+
+   
+
+   ```sql
+   CREATE ALIAS FUNCTION id_masking(INT) WITH PARAMETER(id) AS CONCAT(LEFT(id, 
3), '****', RIGHT(id, 4));
+   ```
+
+5. Create a global custom alias function.
+
+   
+
+   ```sql
+   CREATE GLOBAL ALIAS FUNCTION id_masking(INT) WITH PARAMETER(id) AS 
CONCAT(LEFT(id, 3), '****', RIGHT(id, 4));
+   ```
\ No newline at end of file
diff --git 
a/versioned_docs/version-3.0/sql-manual/sql-statements/function/CREATE-FUNCTION.md
 
b/versioned_docs/version-3.0/sql-manual/sql-statements/function/CREATE-FUNCTION.md
index a26270850ed..d13ade62f81 100644
--- 
a/versioned_docs/version-3.0/sql-manual/sql-statements/function/CREATE-FUNCTION.md
+++ 
b/versioned_docs/version-3.0/sql-manual/sql-statements/function/CREATE-FUNCTION.md
@@ -26,102 +26,131 @@ under the License.
 
 ## Description
 
-This statement creates a custom function. Executing this command requires the 
user to have `ADMIN` privileges.
+This statement is used to create a custom function.
 
-If `function_name` contains the database name, then the custom function will 
be created in the corresponding database, otherwise the function will be 
created in the database where the current session is located. The name and 
parameters of the new function cannot be the same as the existing functions in 
the current namespace, otherwise the creation will fail. But only with the same 
name and different parameters can be created successfully.
+## Syntax
 
-grammar:
 
 ```sql
-CREATE [GLOBAL] [AGGREGATE] [ALIAS] FUNCTION function_name
-    (arg_type [, ...])
-    [RETURNS ret_type]
-    [INTERMEDIATE inter_type]
-    [WITH PARAMETER(param [,...]) AS origin_function]
-    [PROPERTIES ("key" = "value" [, ...]) ]
+CREATE [ GLOBAL ] 
+    [{AGGREGATE | TABLES | ALIAS }] FUNCTION <function_name>
+    (<arg_type> [, ...])
+    [ RETURNS <ret_type> ]
+    [ INTERMEDIATE <inter_type> ]
+    [ WITH PARAMETER(<param> [,...]) AS <origin_function> ]
+    [ PROPERTIES ("<key>" = "<value>" [, ...]) ]
 ```
 
-Parameter Description:
+## Required Parameters
 
-- `GLOBAL`: If there is this item, it means that the created function is a 
global function.
+**1. `<function_name>`**
 
-- `AGGREGATE`: If there is this item, it means that the created function is an 
aggregate function.
+> If `function_name` includes a database name, such as `db1.my_func`, the 
custom function will be created in the corresponding database. Otherwise, the 
function will be created in the database of the current session. The name and 
parameters of the new function must not be identical to an existing function in 
the current namespace; otherwise, the creation will fail.
 
+**2. `<arg_type>`**
 
-- `ALIAS`: If there is this item, it means that the created function is an 
alias function.
+> The input parameter type of the function. For variable-length parameters, 
use `, ...` to indicate them. If it is a variable-length type, the type of the 
variable-length parameters must be consistent with the type of the last 
non-variable-length parameter.
 
+**3. `<ret_type>`**
 
- If the above two items are absent, it means that the created function is a 
scalar function
+> The return parameter type of the function. This is a required parameter for 
creating a new function. If creating an alias for an existing function, this 
parameter is not necessary.
 
-- `function_name`: The name of the function to be created, which can include 
the name of the database. For example: `db1.my_func`.
+## Optional Parameters
 
+**1. `GLOBAL`**
 
-- `arg_type`: The parameter type of the function, which is the same as the 
type defined when creating the table. Variable-length parameters can be 
represented by `, ...`. If it is a variable-length type, the type of the 
variable-length parameter is the same as that of the last non-variable-length 
parameter.
+> If specified, the created function is effective globally.
 
-  **NOTE**: `ALIAS FUNCTION` does not support variable-length arguments and 
must have at least one argument.
+**2. `AGGREGATE`**
 
-- `ret_type`: Required for creating new functions. If you are aliasing an 
existing function, you do not need to fill in this parameter.
+> If specified, the created function is an aggregate function.
 
+**3. `TABLES`**
 
-- `inter_type`: The data type used to represent the intermediate stage of the 
aggregation function.
+> If specified, the created function is a table function.
 
+**4. `ALIAS`**
 
-- `param`: used to represent the parameter of the alias function, including at 
least one.
+> If specified, the created function is an alias function.
 
+> If none of the above parameters representing the function type is selected, 
it indicates that the created function is a scalar function.
 
-- `origin_function`: used to represent the original function corresponding to 
the alias function.
+**5. `<inter_type>`**
 
+> Used to indicate the data type during the intermediate stage of an aggregate 
function.
 
-- `properties`: Used to set function-related properties, the properties that 
can be set include:
+**6. `<param>`**
 
-    - `file`: Indicates the jar package containing the user UDF. In a 
multi-machine environment, you can also use http to download the jar package. 
This parameter is mandatory.
+> Used to indicate the parameters of an alias function, with at least one 
parameter required.
 
-    - `symbol`: Indicates the name of the class containing the UDF class. This 
parameter must be set
+**7. `<origin_function>`**
 
-    - `type`: Indicates the UDF call type, the default is Native, and JAVA_UDF 
is passed when using Java UDF.
+> Used to indicate the original function corresponding to the alias function.
 
-    - `always_nullable`: Indicates whether NULL values may appear in the UDF 
return result, is an optional parameter, and the default value is true.
+**8. `<properties>`**
 
+> - `file`: Indicates the JAR package containing the user-defined function 
(UDF). In a multi-machine environment, it can also be downloaded via HTTP. This 
parameter is mandatory.
+> - `symbol`: Indicates the class name containing the UDF class. This 
parameter is mandatory.
+> - `type`: Indicates the UDF call type. The default is Native. Use JAVA_UDF 
when using a Java UDF.
+> - `always_nullable`: Indicates whether the UDF result may contain NULL 
values. This is an optional parameter with a default value of true.
+
+## Access Control Requirements
+
+To execute this command, the user must have `ADMIN_PRIV` privileges.
 
 ## Example
 
-1. Create a custom UDF function
+1. Create a custom UDF function. For more details, refer to 
[JAVA-UDF](../../../query-data/udf/java-user-defined-function).
+
+   
+
+   ```sql
+   CREATE FUNCTION java_udf_add_one(int) RETURNS int PROPERTIES (
+       "file"="file:///path/to/java-udf-demo-jar-with-dependencies.jar",
+       "symbol"="org.apache.doris.udf.AddOne",
+       "always_nullable"="true",
+       "type"="JAVA_UDF"
+   );
+   ```
+
+2. Create a custom UDAF function.
 
-    ```sql
-    CREATE FUNCTION java_udf_add_one(int) RETURNS int PROPERTIES (
-        "file"="file:///path/to/java-udf-demo-jar-with-dependencies.jar",
-        "symbol"="org.apache.doris.udf.AddOne",
-        "always_nullable"="true",
-        "type"="JAVA_UDF"
-    );
-    ```
+   
 
+   ```sql
+   CREATE AGGREGATE FUNCTION simple_sum(INT) RETURNS INT PROPERTIES (
+       "file"="file:///pathTo/java-udaf.jar",
+       "symbol"="org.apache.doris.udf.demo.SimpleDemo",
+       "always_nullable"="true",
+       "type"="JAVA_UDF"
+   );
+   ```
 
-2. Create a custom UDAF function
+3. Create a custom UDTF function.
 
-    ```sql
-    CREATE AGGREGATE FUNCTION simple_sum(INT) RETURNS INT PROPERTIES (
-        "file"="file:///pathTo/java-udaf.jar",
-        "symbol"="org.apache.doris.udf.demo.SimpleDemo",
-        "always_nullable"="true",
-        "type"="JAVA_UDF"
-    );
-    ```
+   
 
-3. Create a custom alias function
+   ```sql
+   CREATE TABLES FUNCTION java_udtf(string, string) RETURNS array<string> 
PROPERTIES (
+       "file"="file:///pathTo/java-udaf.jar",
+       "symbol"="org.apache.doris.udf.demo.UDTFStringTest",
+       "always_nullable"="true",
+       "type"="JAVA_UDF"
+   );
+   ```
 
-    ```sql
-    CREATE ALIAS FUNCTION id_masking(INT) WITH PARAMETER(id) AS 
CONCAT(LEFT(id, 3), '****', RIGHT(id, 4));
-    ```
+4. Create a custom alias function. For more information, refer to [Alias 
Function](../../../query-data/udf/alias-function).
 
-4. Create a global custom alias function
+   
 
-    ```sql
-    CREATE GLOBAL ALIAS FUNCTION id_masking(INT) WITH PARAMETER(id) AS 
CONCAT(LEFT(id, 3), '****', RIGHT(id, 4));
-    ```
+   ```sql
+   CREATE ALIAS FUNCTION id_masking(INT) WITH PARAMETER(id) AS CONCAT(LEFT(id, 
3), '****', RIGHT(id, 4));
+   ```
 
-## Keywords
+5. Create a global custom alias function.
 
-    CREATE, FUNCTION
+   
 
-## Best Practice
+   ```sql
+   CREATE GLOBAL ALIAS FUNCTION id_masking(INT) WITH PARAMETER(id) AS 
CONCAT(LEFT(id, 3), '****', RIGHT(id, 4));
+   ```
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to