fix: change example name in document

This commit is contained in:
shenglian zhou 2022-11-19 10:05:24 +08:00
parent bfa3d1fa27
commit 77e3cc42b9
4 changed files with 10 additions and 10 deletions

View File

@ -205,13 +205,13 @@ Additional functions are defined in `taosudf.h` to make it easier to work with t
To use your user-defined function in TDengine, first compile it to a dynamically linked library (DLL). To use your user-defined function in TDengine, first compile it to a dynamically linked library (DLL).
For example, the sample UDF `add_one.c` can be compiled into a DLL as follows: For example, the sample UDF `bit_and.c` can be compiled into a DLL as follows:
```bash ```bash
gcc -g -O0 -fPIC -shared add_one.c -o add_one.so gcc -g -O0 -fPIC -shared bit_and.c -o libbitand.so
``` ```
The generated DLL file `add_one.so` can now be used to implement your function. Note: GCC 7.5 or later is required. The generated DLL file `libbitand.so` can now be used to implement your function. Note: GCC 7.5 or later is required.
## Manage and Use User-Defined Functions ## Manage and Use User-Defined Functions
After compiling your function into a DLL, you add it to TDengine. For more information, see [User-Defined Functions](../12-taos-sql/26-udf.md). After compiling your function into a DLL, you add it to TDengine. For more information, see [User-Defined Functions](../12-taos-sql/26-udf.md).

View File

@ -62,7 +62,7 @@ SHOW FUNCTIONS;
The function name specified when creating UDF can be used directly in SQL statements, just like builtin functions. For example: The function name specified when creating UDF can be used directly in SQL statements, just like builtin functions. For example:
```sql ```sql
SELECT X(c1,c2) FROM table/stable; SELECT bit_and(c1,c2) FROM table;
``` ```
The above SQL statement invokes function X for column c1 and c2. You can use query keywords like WHERE with user-defined functions. The above SQL statement invokes function X for column c1 and c2 on table. You can use query keywords like WHERE with user-defined functions.

View File

@ -205,13 +205,13 @@ typedef struct SUdfInterBuf {
用户定义函数的 C 语言源代码无法直接被 TDengine 系统使用,而是需要先编译为 动态链接库,之后才能载入 TDengine 系统。 用户定义函数的 C 语言源代码无法直接被 TDengine 系统使用,而是需要先编译为 动态链接库,之后才能载入 TDengine 系统。
例如,按照上一章节描述的规则准备好了用户定义函数的源代码 add_one.c以 Linux 为例可以执行如下指令编译得到动态链接库文件: 例如,按照上一章节描述的规则准备好了用户定义函数的源代码 bit_and.c以 Linux 为例可以执行如下指令编译得到动态链接库文件:
```bash ```bash
gcc -g -O0 -fPIC -shared add_one.c -o add_one.so gcc -g -O0 -fPIC -shared bit_and.c -o libbitand.so
``` ```
这样就准备好了动态链接库 add_one.so 文件,可以供后文创建 UDF 时使用了。为了保证可靠的系统运行,编译器 GCC 推荐使用 7.5 及以上版本。 这样就准备好了动态链接库 libbitand.so 文件,可以供后文创建 UDF 时使用了。为了保证可靠的系统运行,编译器 GCC 推荐使用 7.5 及以上版本。
## 管理和使用UDF ## 管理和使用UDF
编译好的UDF还需要将其加入到系统才能被正常的SQL调用。关于如何管理和使用UDF参见[UDF使用说明](../12-taos-sql/26-udf.md) 编译好的UDF还需要将其加入到系统才能被正常的SQL调用。关于如何管理和使用UDF参见[UDF使用说明](../12-taos-sql/26-udf.md)

View File

@ -63,7 +63,7 @@ SHOW FUNCTIONS;
在 SQL 指令中,可以直接以在系统中创建 UDF 时赋予的函数名来调用用户定义函数。例如: 在 SQL 指令中,可以直接以在系统中创建 UDF 时赋予的函数名来调用用户定义函数。例如:
```sql ```sql
SELECT X(c1,c2) FROM table/stable; SELECT bit_and(c1,c2) FROM table;
``` ```
表示对名为 c1, c2 的数据列调用名为 X 的用户定义函数。SQL 指令中用户定义函数可以配合 WHERE 等查询特性来使用。 表示对表 table 上名为 c1, c2 的数据列调用名为 bit_and 的用户定义函数。SQL 指令中用户定义函数可以配合 WHERE 等查询特性来使用。