You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2021/08/27 04:59:42 UTC
[iotdb] branch rel/0.12 updated: [IOTDB-1591] Execute CREATE
FUNCTION on 1 node, this FUNCTION is invisible to other nodes (#3853)
This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch rel/0.12
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/rel/0.12 by this push:
new b06ab91 [IOTDB-1591] Execute CREATE FUNCTION on 1 node, this FUNCTION is invisible to other nodes (#3853)
b06ab91 is described below
commit b06ab91c5e648bdbbc7ba8f6d0e9225e0d009d2c
Author: Steve Yurong Su (宇荣) <ro...@apache.org>
AuthorDate: Thu Aug 26 23:59:19 2021 -0500
[IOTDB-1591] Execute CREATE FUNCTION on 1 node, this FUNCTION is invisible to other nodes (#3853)
---
docs/UserGuide/UDF/UDF-User-Defined-Function.md | 10 +++++-----
docs/zh/UserGuide/UDF/UDF-User-Defined-Function.md | 10 +++++-----
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/docs/UserGuide/UDF/UDF-User-Defined-Function.md b/docs/UserGuide/UDF/UDF-User-Defined-Function.md
index 53e0113..72d3ec7 100644
--- a/docs/UserGuide/UDF/UDF-User-Defined-Function.md
+++ b/docs/UserGuide/UDF/UDF-User-Defined-Function.md
@@ -48,7 +48,7 @@ If you use [Maven](http://search.maven.org/), you can search for the development
<dependency>
<groupId>org.apache.iotdb</groupId>
<artifactId>iotdb-server</artifactId>
- <version>0.12.0-SNAPSHOT</version>
+ <version>0.12.x</version>
<scope>provided</scope>
</dependency>
```
@@ -388,8 +388,8 @@ The process of registering a UDF in IoTDB is as follows:
1. Implement a complete UDF class, assuming the full class name of this class is `org.apache.iotdb.udf.ExampleUDTF`.
2. Package your project into a JAR. If you use Maven to manage your project, you can refer to the Maven project example above.
-3. Place the JAR package in the directory `iotdb-server-0.12.0-SNAPSHOT/ext/udf` or in a subdirectory of `iotdb-server-0.12.0-SNAPSHOT/ext/udf`.
-
+3. Place the JAR package in the directory `iotdb-server-0.12.x-all-bin/ext/udf` or in a subdirectory of `iotdb-server-0.12.x-all-bin/ext/udf`. **Note that when deploying a cluster, you need to ensure that there is a corresponding JAR package in the UDF JAR package path of each node. **
+
> You can specify the root path for the UDF to load the Jar by modifying the 'udf_root_dir' in the configuration file.
4. Register the UDF with the SQL statement, assuming that the name given to the UDF is `example`.
@@ -581,7 +581,7 @@ Q1: **How to modify the registered UDF? **
A1: Assume that the name of the UDF is `example` and the full class name is `org.apache.iotdb.udf.ExampleUDTF`, which is introduced by `example.jar`.
1. Unload the registered function by executing `DROP FUNCTION example`.
-2. Delete `example.jar` under `iotdb-server-0.12.0-SNAPSHOT/ext/udf`.
+2. Delete `example.jar` under `iotdb-server-0.12.x-all-bin/ext/udf`.
3. Modify the logic in `org.apache.iotdb.udf.ExampleUDTF` and repackage it. The name of the JAR package can still be `example.jar`.
-4. Upload the new JAR package to `iotdb-server-0.12.0-SNAPSHOT/ext/udf`.
+4. Upload the new JAR package to `iotdb-server-0.12.x-all-bin/ext/udf`.
5. Load the new UDF by executing `CREATE FUNCTION example AS "org.apache.iotdb.udf.ExampleUDTF"`.
diff --git a/docs/zh/UserGuide/UDF/UDF-User-Defined-Function.md b/docs/zh/UserGuide/UDF/UDF-User-Defined-Function.md
index d5aac0e..64d90c9 100644
--- a/docs/zh/UserGuide/UDF/UDF-User-Defined-Function.md
+++ b/docs/zh/UserGuide/UDF/UDF-User-Defined-Function.md
@@ -48,7 +48,7 @@ IoTDB 支持两种类型的 UDF 函数,如下表所示。
<dependency>
<groupId>org.apache.iotdb</groupId>
<artifactId>iotdb-server</artifactId>
- <version>0.12.0-SNAPSHOT</version>
+ <version>0.12.x</version>
<scope>provided</scope>
</dependency>
```
@@ -388,8 +388,8 @@ UDTF的结束方法,您可以在此方法中进行一些资源释放等的操
1. 实现一个完整的UDF类,假定这个类的全类名为`org.apache.iotdb.udf.UDTFExample`
2. 将项目打成JAR包,如果您使用Maven管理项目,可以参考上述Maven项目示例的写法
-3. 将JAR包放置到目录 `iotdb-server-0.12.0-SNAPSHOT/ext/udf` (也可以是`iotdb-server-0.12.0-SNAPSHOT/ext/udf`的子目录)下。
-
+3. 将JAR包放置到目录 `iotdb-server-0.12.x-all-bin/ext/udf` (也可以是`iotdb-server-0.12.x-all-bin/ext/udf`的子目录)下。**注意,在部署集群的时候,需要保证每一个节点的 UDF JAR 包路径下都存在相应的 JAR 包。**
+
> 您可以通过修改配置文件中的`udf_root_dir`来指定UDF加载Jar的根路径。
4. 使用SQL语句注册该UDF,假定赋予该UDF的名字为`example`
@@ -585,7 +585,7 @@ SHOW FUNCTIONS
A1: 假设UDF的名称为`example`,全类名为`org.apache.iotdb.udf.UDTFExample`,由`example.jar`引入
1. 首先卸载已经注册的`example`函数,执行`DROP FUNCTION example`
-2. 删除 `iotdb-server-0.12.0-SNAPSHOT/ext/udf` 目录下的`example.jar`
+2. 删除 `iotdb-server-0.12.x-all-bin/ext/udf` 目录下的`example.jar`
3. 修改`org.apache.iotdb.udf.UDTFExample`中的逻辑,重新打包,JAR包的名字可以仍然为`example.jar`
-4. 将新的JAR包上传至 `iotdb-server-0.12.0-SNAPSHOT/ext/udf` 目录下
+4. 将新的JAR包上传至 `iotdb-server-0.12.x-all-bin/ext/udf` 目录下
5. 装载新的UDF,执行`CREATE FUNCTION example AS "org.apache.iotdb.udf.UDTFExample"`