You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ro...@apache.org on 2022/12/15 07:32:46 UTC

[iotdb] branch IOTDB-5195 updated (d79568b436 -> 84ec585cb6)

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

rong pushed a change to branch IOTDB-5195
in repository https://gitbox.apache.org/repos/asf/iotdb.git


    from d79568b436 remove mappable api from pyudf package
     new 2cd4808462 basic udf class struct
     new 4b262b96b2 refactor python udf package
     new ba611576e0 refactor udf package
     new 84ec585cb6 rpc framework

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 pom.xml                                            |  2 +
 .../multi/UniversalUDFQueryTransformer.java        |  2 +-
 .../transformation/dag/udf/base/UDTFExecutor.java  |  5 +-
 .../dag/udf/python/PythonPointCollector.java       |  6 +--
 .../transformation/dag/udf/python/PythonUDTF.java  | 38 ++++++++++----
 .../dag/udf/python/PythonUDTFExecutor.java         | 61 ++++++++++++++++++++++
 .../dag/udf/python/PythonUDTFPointCollector.java   |  4 +-
 {thrift-influxdb => thrift-udf}/pom.xml            | 48 ++++++-----------
 .../src/main/thrift/udf.thrift                     |  4 +-
 udf-py/.gitignore                                  |  1 +
 udf-py/{udf_api => iotdb}/__init__.py              |  0
 udf-py/{udf_api/access => iotdb/udf}/__init__.py   |  0
 .../collector => iotdb/udf/api}/__init__.py        |  0
 .../udf/api/access}/__init__.py                    |  0
 udf-py/{udf_api => iotdb/udf/api}/access/row.py    |  4 +-
 .../udf/api}/access/row_iterator.py                |  0
 .../udf/api}/access/row_window.py                  |  6 +--
 .../config => iotdb/udf/api/collector}/__init__.py |  0
 .../udf/api}/collector/point_collector.py          |  2 +-
 .../udf/api/customizer}/__init__.py                |  0
 .../udf/api/customizer/config}/__init__.py         |  0
 .../api}/customizer/config/udf_configurations.py   |  4 +-
 .../api}/customizer/config/udtf_configurations.py  |  8 +--
 .../udf/api/customizer/parameter}/__init__.py      |  0
 .../parameter/udf_parameter_validator.py           | 14 ++---
 .../api}/customizer/parameter/udf_parameters.py    |  2 +-
 .../udf/api/customizer/strategy}/__init__.py       |  0
 .../api}/customizer/strategy/access_strategy.py    |  2 +-
 .../customizer/strategy/access_strategy_type.py    |  0
 .../strategy/row_by_row_access_strategy.py         |  4 +-
 .../session_time_window_access_strategy.py         |  6 +--
 .../sliding_size_window_access_strategy.py         |  6 +--
 .../sliding_time_window_access_strategy.py         |  6 +--
 .../strategy/state_window_access_strategy.py       |  6 +--
 .../udf/api/exception}/__init__.py                 |  0
 .../udf_attribute_not_provided_exception.py        |  2 +-
 .../udf/api}/exception/udf_exception.py            |  0
 ...f_input_series_data_type_not_valid_exception.py |  4 +-
 .../udf_input_series_index_not_valid_exception.py  |  2 +-
 .../udf_input_series_number_not_valid_exception.py |  2 +-
 .../udf/api}/exception/udf_management_exception.py |  2 +-
 ..._output_series_data_type_not_valid_exception.py |  2 +-
 .../exception/udf_parameter_not_valid_exception.py |  2 +-
 udf-py/{udf_api => iotdb/udf/api/type}/__init__.py |  0
 udf-py/{udf_api => iotdb/udf/api}/type/binary.py   |  0
 udf-py/{udf_api => iotdb/udf/api}/type/type.py     |  0
 udf-py/{udf_api => iotdb/udf/api}/udf.py           |  4 +-
 udf-py/{udf_api => iotdb/udf/api}/udtf.py          | 12 ++---
 udf-py/{udf_api => iotdb/udf/protocol}/__init__.py |  0
 udf-py/{udf_api => iotdb/udf/runtime}/__init__.py  |  0
 {client-py => udf-py}/pom.xml                      | 20 +++----
 udf-py/setup.py                                    |  4 +-
 52 files changed, 182 insertions(+), 115 deletions(-)
 copy node-commons/src/main/java/org/apache/iotdb/commons/schema/tree/ITreeNode.java => server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/udf/python/PythonPointCollector.java (89%)
 copy node-commons/src/main/java/org/apache/iotdb/commons/udf/builtin/String/UDTFStrLength.java => server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/udf/python/PythonUDTF.java (66%)
 create mode 100644 server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/udf/python/PythonUDTFExecutor.java
 copy confignode/src/test/java/org/apache/iotdb/confignode/procedure/env/TestConfigNodeEnv.java => server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/udf/python/PythonUDTFPointCollector.java (88%)
 copy {thrift-influxdb => thrift-udf}/pom.xml (65%)
 copy confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNodeMBean.java => thrift-udf/src/main/thrift/udf.thrift (87%)
 copy udf-py/{udf_api => iotdb}/__init__.py (100%)
 rename udf-py/{udf_api/access => iotdb/udf}/__init__.py (100%)
 rename udf-py/{udf_api/collector => iotdb/udf/api}/__init__.py (100%)
 rename udf-py/{udf_api/customizer => iotdb/udf/api/access}/__init__.py (100%)
 rename udf-py/{udf_api => iotdb/udf/api}/access/row.py (97%)
 rename udf-py/{udf_api => iotdb/udf/api}/access/row_iterator.py (100%)
 rename udf-py/{udf_api => iotdb/udf/api}/access/row_window.py (96%)
 rename udf-py/{udf_api/customizer/config => iotdb/udf/api/collector}/__init__.py (100%)
 rename udf-py/{udf_api => iotdb/udf/api}/collector/point_collector.py (98%)
 rename udf-py/{udf_api/customizer/parameter => iotdb/udf/api/customizer}/__init__.py (100%)
 rename udf-py/{udf_api/customizer/strategy => iotdb/udf/api/customizer/config}/__init__.py (100%)
 rename udf-py/{udf_api => iotdb/udf/api}/customizer/config/udf_configurations.py (91%)
 rename udf-py/{udf_api => iotdb/udf/api}/customizer/config/udtf_configurations.py (89%)
 rename udf-py/{udf_api/exception => iotdb/udf/api/customizer/parameter}/__init__.py (100%)
 rename udf-py/{udf_api => iotdb/udf/api}/customizer/parameter/udf_parameter_validator.py (91%)
 rename udf-py/{udf_api => iotdb/udf/api}/customizer/parameter/udf_parameters.py (98%)
 rename udf-py/{udf_api/type => iotdb/udf/api/customizer/strategy}/__init__.py (100%)
 rename udf-py/{udf_api => iotdb/udf/api}/customizer/strategy/access_strategy.py (94%)
 rename udf-py/{udf_api => iotdb/udf/api}/customizer/strategy/access_strategy_type.py (100%)
 rename udf-py/{udf_api => iotdb/udf/api}/customizer/strategy/row_by_row_access_strategy.py (90%)
 rename udf-py/{udf_api => iotdb/udf/api}/customizer/strategy/session_time_window_access_strategy.py (92%)
 rename udf-py/{udf_api => iotdb/udf/api}/customizer/strategy/sliding_size_window_access_strategy.py (94%)
 rename udf-py/{udf_api => iotdb/udf/api}/customizer/strategy/sliding_time_window_access_strategy.py (95%)
 rename udf-py/{udf_api => iotdb/udf/api}/customizer/strategy/state_window_access_strategy.py (92%)
 rename udf-py/{udf_runtime => iotdb/udf/api/exception}/__init__.py (100%)
 rename udf-py/{udf_api => iotdb/udf/api}/exception/udf_attribute_not_provided_exception.py (93%)
 rename udf-py/{udf_api => iotdb/udf/api}/exception/udf_exception.py (100%)
 rename udf-py/{udf_api => iotdb/udf/api}/exception/udf_input_series_data_type_not_valid_exception.py (91%)
 rename udf-py/{udf_api => iotdb/udf/api}/exception/udf_input_series_index_not_valid_exception.py (94%)
 rename udf-py/{udf_api => iotdb/udf/api}/exception/udf_input_series_number_not_valid_exception.py (95%)
 rename udf-py/{udf_api => iotdb/udf/api}/exception/udf_management_exception.py (93%)
 rename udf-py/{udf_api => iotdb/udf/api}/exception/udf_output_series_data_type_not_valid_exception.py (94%)
 rename udf-py/{udf_api => iotdb/udf/api}/exception/udf_parameter_not_valid_exception.py (93%)
 copy udf-py/{udf_api => iotdb/udf/api/type}/__init__.py (100%)
 rename udf-py/{udf_api => iotdb/udf/api}/type/binary.py (100%)
 rename udf-py/{udf_api => iotdb/udf/api}/type/type.py (100%)
 rename udf-py/{udf_api => iotdb/udf/api}/udf.py (92%)
 rename udf-py/{udf_api => iotdb/udf/api}/udtf.py (91%)
 copy udf-py/{udf_api => iotdb/udf/protocol}/__init__.py (100%)
 rename udf-py/{udf_api => iotdb/udf/runtime}/__init__.py (100%)
 copy {client-py => udf-py}/pom.xml (89%)


[iotdb] 04/04: rpc framework

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rong pushed a commit to branch IOTDB-5195
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 84ec585cb63c747af4c498004f73d0314e3f1dd9
Author: Steve Yurong Su <ro...@apache.org>
AuthorDate: Thu Dec 15 15:32:31 2022 +0800

    rpc framework
---
 pom.xml                               |   2 +
 thrift-udf/pom.xml                    |  84 ++++++++++++++++++++++
 thrift-udf/src/main/thrift/udf.thrift |  21 ++++++
 udf-py/.gitignore                     |   1 +
 udf-py/iotdb/udf/protocol/__init__.py |  16 +++++
 udf-py/pom.xml                        | 131 ++++++++++++++++++++++++++++++++++
 6 files changed, 255 insertions(+)

diff --git a/pom.xml b/pom.xml
index 7b20282b23..6ee1b621fc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -86,6 +86,7 @@
         <module>thrift-confignode</module>
         <module>thrift-iot-consensus</module>
         <module>thrift-influxdb</module>
+        <module>thrift-udf</module>
         <module>service-rpc</module>
         <module>jdbc</module>
         <module>influxdb-protocol</module>
@@ -118,6 +119,7 @@
         <module>library-udf</module>
         <module>schema-engine-rocksdb</module>
         <module>udf-api</module>
+        <module>udf-py</module>
         <module>trigger-api</module>
         <module>rewrite-tsfile-tool</module>
         <module>external-api</module>
diff --git a/thrift-udf/pom.xml b/thrift-udf/pom.xml
new file mode 100644
index 0000000000..b2261cdf19
--- /dev/null
+++ b/thrift-udf/pom.xml
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.iotdb</groupId>
+        <artifactId>iotdb-parent</artifactId>
+        <version>1.0.1-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <artifactId>iotdb-thrift-udf</artifactId>
+    <name>rpc-thrift-udf</name>
+    <description>RPC (Thrift) framework for UDF.</description>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.thrift</groupId>
+            <artifactId>libthrift</artifactId>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <!-- generate thrift source code -->
+            <plugin>
+                <groupId>org.apache.thrift.tools</groupId>
+                <artifactId>maven-thrift-plugin</artifactId>
+                <version>0.1.11</version>
+                <executions>
+                    <execution>
+                        <id>generate-thrift-udf-sources-py</id>
+                        <!-- Move from generate-sources to generate-resources to avoid double executions -->
+                        <phase>generate-resources</phase>
+                        <goals>
+                            <goal>compile</goal>
+                        </goals>
+                        <configuration>
+                            <generator>py</generator>
+                            <thriftExecutable>${thrift.exec.absolute.path}</thriftExecutable>
+                            <thriftSourceRoot>${basedir}/src/main/thrift</thriftSourceRoot>
+                            <outputDirectory>${basedir}/target/generated-sources-python/</outputDirectory>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <version>3.2.0</version>
+                <executions>
+                    <execution>
+                        <id>add-source</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>add-source</goal>
+                        </goals>
+                        <configuration>
+                            <sources>
+                                <source>${project.build.directory}/generated-sources/thrift</source>
+                            </sources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
diff --git a/thrift-udf/src/main/thrift/udf.thrift b/thrift-udf/src/main/thrift/udf.thrift
new file mode 100644
index 0000000000..9e79d40944
--- /dev/null
+++ b/thrift-udf/src/main/thrift/udf.thrift
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+namespace java org.apache.iotdb.db.mpp.transformation.dag.udf.protocol.rpc
+namespace py iotdb.udf.protocol.rpc
diff --git a/udf-py/.gitignore b/udf-py/.gitignore
index 237854a3c0..b4a693de4b 100644
--- a/udf-py/.gitignore
+++ b/udf-py/.gitignore
@@ -1,3 +1,4 @@
+/iotdb/udf/protocol/rpc/
 # generated by Pypi
 /build/
 /dist/
diff --git a/udf-py/iotdb/udf/protocol/__init__.py b/udf-py/iotdb/udf/protocol/__init__.py
new file mode 100644
index 0000000000..b74423fa90
--- /dev/null
+++ b/udf-py/iotdb/udf/protocol/__init__.py
@@ -0,0 +1,16 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
diff --git a/udf-py/pom.xml b/udf-py/pom.xml
new file mode 100644
index 0000000000..3ffa101c9e
--- /dev/null
+++ b/udf-py/pom.xml
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.iotdb</groupId>
+        <artifactId>iotdb-parent</artifactId>
+        <version>1.0.1-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <artifactId>iotdb-python-udf</artifactId>
+    <name>python-udf</name>
+    <description>Python UDF of IoTDB.</description>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.iotdb</groupId>
+            <artifactId>iotdb-thrift</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.iotdb</groupId>
+            <artifactId>iotdb-thrift-commons</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+    <properties>
+        <thrift.exec.absolute.path>${project.parent.basedir}/tools/${thrift.executable}</thrift.exec.absolute.path>
+    </properties>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-checkstyle-plugin</artifactId>
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+            </plugin>
+            <!-- clean thrift folder -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-clean-plugin</artifactId>
+                <version>2.4.1</version>
+                <configuration>
+                    <filesets>
+                        <fileset>
+                            <directory>iotdb/udf/protocol</directory>
+                            <includes>
+                                <include>rpc/</include>
+                            </includes>
+                            <followSymlinks>false</followSymlinks>
+                        </fileset>
+                        <fileset>
+                            <directory>./</directory>
+                            <includes>
+                                <include>LICENSE</include>
+                            </includes>
+                        </fileset>
+                    </filesets>
+                </configuration>
+            </plugin>
+            <!-- fill thrift folder -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-resources-plugin</artifactId>
+                <version>2.4.3</version>
+                <configuration>
+                    <encoding>${project.build.sourceEncoding}</encoding>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>copy-thrift-python-resources</id>
+                        <!-- here the phase you need -->
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <encoding>utf-8</encoding>
+                            <outputDirectory>${basedir}/iotdb/udf/protocol/rpc/</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>${basedir}/../thrift-udf/target/generated-sources-python/iotdb/udf/protocol/rpc/</directory>
+                                </resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+                    <!-- Copy License -->
+                    <execution>
+                        <id>copy-pypi-file-resources</id>
+                        <!-- here the phase you need -->
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <encoding>utf-8</encoding>
+                            <outputDirectory>${basedir}/</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>${basedir}/..</directory>
+                                    <includes>
+                                        <include>LICENSE</include>
+                                    </includes>
+                                </resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>


[iotdb] 02/04: refactor python udf package

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rong pushed a commit to branch IOTDB-5195
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 4b262b96b2fc127b2f82218f0171cb16eb401e1e
Author: Steve Yurong Su <ro...@apache.org>
AuthorDate: Wed Dec 14 04:38:56 2022 +0800

    refactor python udf package
---
 udf-py/{udf_api => udf}/__init__.py                        |  0
 udf-py/{udf_api/access => udf/api}/__init__.py             |  0
 udf-py/{udf_api/collector => udf/api/access}/__init__.py   |  0
 udf-py/{udf_api => udf/api}/access/row.py                  |  4 ++--
 udf-py/{udf_api => udf/api}/access/row_iterator.py         |  0
 udf-py/{udf_api => udf/api}/access/row_window.py           |  6 +++---
 .../{udf_api/customizer => udf/api/collector}/__init__.py  |  0
 udf-py/{udf_api => udf/api}/collector/point_collector.py   |  2 +-
 .../customizer/config => udf/api/customizer}/__init__.py   |  0
 .../parameter => udf/api/customizer/config}/__init__.py    |  0
 .../api}/customizer/config/udf_configurations.py           |  4 ++--
 .../api}/customizer/config/udtf_configurations.py          |  8 ++++----
 .../strategy => udf/api/customizer/parameter}/__init__.py  |  0
 .../api}/customizer/parameter/udf_parameter_validator.py   | 14 +++++++-------
 .../api}/customizer/parameter/udf_parameters.py            |  2 +-
 .../exception => udf/api/customizer/strategy}/__init__.py  |  0
 .../api}/customizer/strategy/access_strategy.py            |  2 +-
 .../api}/customizer/strategy/access_strategy_type.py       |  0
 .../api}/customizer/strategy/row_by_row_access_strategy.py |  4 ++--
 .../strategy/session_time_window_access_strategy.py        |  6 +++---
 .../strategy/sliding_size_window_access_strategy.py        |  6 +++---
 .../strategy/sliding_time_window_access_strategy.py        |  6 +++---
 .../customizer/strategy/state_window_access_strategy.py    |  6 +++---
 udf-py/{udf_api/type => udf/api/exception}/__init__.py     |  0
 .../api}/exception/udf_attribute_not_provided_exception.py |  2 +-
 udf-py/{udf_api => udf/api}/exception/udf_exception.py     |  0
 .../udf_input_series_data_type_not_valid_exception.py      |  4 ++--
 .../udf_input_series_index_not_valid_exception.py          |  2 +-
 .../udf_input_series_number_not_valid_exception.py         |  2 +-
 .../api}/exception/udf_management_exception.py             |  2 +-
 .../udf_output_series_data_type_not_valid_exception.py     |  2 +-
 .../api}/exception/udf_parameter_not_valid_exception.py    |  2 +-
 udf-py/{udf_runtime => udf/api/type}/__init__.py           |  0
 udf-py/{udf_api => udf/api}/type/binary.py                 |  0
 udf-py/{udf_api => udf/api}/type/type.py                   |  0
 udf-py/{udf_api => udf/api}/udf.py                         |  2 +-
 udf-py/{udf_api => udf/api}/udtf.py                        | 12 ++++++------
 udf-py/{udf_api => udf/runtime}/__init__.py                |  0
 38 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/udf-py/udf_api/__init__.py b/udf-py/udf/__init__.py
similarity index 100%
copy from udf-py/udf_api/__init__.py
copy to udf-py/udf/__init__.py
diff --git a/udf-py/udf_api/access/__init__.py b/udf-py/udf/api/__init__.py
similarity index 100%
rename from udf-py/udf_api/access/__init__.py
rename to udf-py/udf/api/__init__.py
diff --git a/udf-py/udf_api/collector/__init__.py b/udf-py/udf/api/access/__init__.py
similarity index 100%
rename from udf-py/udf_api/collector/__init__.py
rename to udf-py/udf/api/access/__init__.py
diff --git a/udf-py/udf_api/access/row.py b/udf-py/udf/api/access/row.py
similarity index 98%
rename from udf-py/udf_api/access/row.py
rename to udf-py/udf/api/access/row.py
index ae9e8b87a4..781de785ea 100644
--- a/udf-py/udf_api/access/row.py
+++ b/udf-py/udf/api/access/row.py
@@ -17,8 +17,8 @@
 
 from abc import ABCMeta, abstractmethod
 
-from udf_api.type.binary import Binary
-from udf_api.type.type import Type
+from udf.api.type.binary import Binary
+from udf.api.type.type import Type
 
 
 class Row(metaclass=ABCMeta):
diff --git a/udf-py/udf_api/access/row_iterator.py b/udf-py/udf/api/access/row_iterator.py
similarity index 100%
rename from udf-py/udf_api/access/row_iterator.py
rename to udf-py/udf/api/access/row_iterator.py
diff --git a/udf-py/udf_api/access/row_window.py b/udf-py/udf/api/access/row_window.py
similarity index 96%
rename from udf-py/udf_api/access/row_window.py
rename to udf-py/udf/api/access/row_window.py
index 783c2bb2bd..321fbd65da 100644
--- a/udf-py/udf_api/access/row_window.py
+++ b/udf-py/udf/api/access/row_window.py
@@ -18,9 +18,9 @@
 
 from abc import ABCMeta, abstractmethod
 
-from udf_api.access.row import Row
-from udf_api.access.row_iterator import RowIterator
-from udf_api.type.type import Type
+from udf.api.access.row import Row
+from udf.api.access.row_iterator import RowIterator
+from udf.api.type.type import Type
 
 
 class RowWindow(metaclass=ABCMeta):
diff --git a/udf-py/udf_api/customizer/__init__.py b/udf-py/udf/api/collector/__init__.py
similarity index 100%
rename from udf-py/udf_api/customizer/__init__.py
rename to udf-py/udf/api/collector/__init__.py
diff --git a/udf-py/udf_api/collector/point_collector.py b/udf-py/udf/api/collector/point_collector.py
similarity index 99%
rename from udf-py/udf_api/collector/point_collector.py
rename to udf-py/udf/api/collector/point_collector.py
index 2c35439222..9143917c94 100644
--- a/udf-py/udf_api/collector/point_collector.py
+++ b/udf-py/udf/api/collector/point_collector.py
@@ -17,7 +17,7 @@
 
 from abc import ABCMeta, abstractmethod
 
-from udf_api.type.binary import Binary
+from udf.api.type.binary import Binary
 
 
 class PointCollector(metaclass=ABCMeta):
diff --git a/udf-py/udf_api/customizer/config/__init__.py b/udf-py/udf/api/customizer/__init__.py
similarity index 100%
rename from udf-py/udf_api/customizer/config/__init__.py
rename to udf-py/udf/api/customizer/__init__.py
diff --git a/udf-py/udf_api/customizer/parameter/__init__.py b/udf-py/udf/api/customizer/config/__init__.py
similarity index 100%
rename from udf-py/udf_api/customizer/parameter/__init__.py
rename to udf-py/udf/api/customizer/config/__init__.py
diff --git a/udf-py/udf_api/customizer/config/udf_configurations.py b/udf-py/udf/api/customizer/config/udf_configurations.py
similarity index 92%
rename from udf-py/udf_api/customizer/config/udf_configurations.py
rename to udf-py/udf/api/customizer/config/udf_configurations.py
index 14f9a45d2a..5385590075 100644
--- a/udf-py/udf_api/customizer/config/udf_configurations.py
+++ b/udf-py/udf/api/customizer/config/udf_configurations.py
@@ -17,8 +17,8 @@
 
 from abc import ABCMeta
 
-from udf_api.exception.udf_exception import UDFException
-from udf_api.type.type import Type
+from udf.api.exception.udf_exception import UDFException
+from udf.api.type.type import Type
 
 
 class UDFConfigurations(metaclass=ABCMeta):
diff --git a/udf-py/udf_api/customizer/config/udtf_configurations.py b/udf-py/udf/api/customizer/config/udtf_configurations.py
similarity index 90%
rename from udf-py/udf_api/customizer/config/udtf_configurations.py
rename to udf-py/udf/api/customizer/config/udtf_configurations.py
index 99881bc26b..b9aeb32ed2 100644
--- a/udf-py/udf_api/customizer/config/udtf_configurations.py
+++ b/udf-py/udf/api/customizer/config/udtf_configurations.py
@@ -15,10 +15,10 @@
 # specific language governing permissions and limitations
 # under the License.
 
-from udf_api.customizer.config.udf_configurations import UDFConfigurations
-from udf_api.customizer.strategy.access_strategy import AccessStrategy
-from udf_api.exception.udf_exception import UDFException
-from udf_api.type.type import Type
+from udf.api.customizer import UDFConfigurations
+from udf.api.customizer import AccessStrategy
+from udf.api.exception import UDFException
+from udf.api.type import Type
 
 
 class UDTFConfigurations(UDFConfigurations):
diff --git a/udf-py/udf_api/customizer/strategy/__init__.py b/udf-py/udf/api/customizer/parameter/__init__.py
similarity index 100%
rename from udf-py/udf_api/customizer/strategy/__init__.py
rename to udf-py/udf/api/customizer/parameter/__init__.py
diff --git a/udf-py/udf_api/customizer/parameter/udf_parameter_validator.py b/udf-py/udf/api/customizer/parameter/udf_parameter_validator.py
similarity index 92%
rename from udf-py/udf_api/customizer/parameter/udf_parameter_validator.py
rename to udf-py/udf/api/customizer/parameter/udf_parameter_validator.py
index 0194b60765..6b2df67f51 100644
--- a/udf-py/udf_api/customizer/parameter/udf_parameter_validator.py
+++ b/udf-py/udf/api/customizer/parameter/udf_parameter_validator.py
@@ -17,23 +17,23 @@
 
 from typing import List
 
-from udf_api.customizer.parameter.udf_parameters import UDFParameters
-from udf_api.exception.udf_attribute_not_provided_exception import (
+from udf.api.customizer.parameter.udf_parameters import UDFParameters
+from udf.api.exception.udf_attribute_not_provided_exception import (
     UDFAttributeNotProvidedException,
 )
-from udf_api.exception.udf_input_series_data_type_not_valid_exception import (
+from udf.api.exception.udf_input_series_data_type_not_valid_exception import (
     UDFInputSeriesDataTypeNotValidException,
 )
-from udf_api.exception.udf_input_series_index_not_valid_exception import (
+from udf.api.exception.udf_input_series_index_not_valid_exception import (
     UDFInputSeriesIndexNotValidException,
 )
-from udf_api.exception.udf_input_series_number_not_valid_exception import (
+from udf.api.exception.udf_input_series_number_not_valid_exception import (
     UDFInputSeriesNumberNotValidException,
 )
-from udf_api.exception.udf_parameter_not_valid_exception import (
+from udf.api.exception.udf_parameter_not_valid_exception import (
     UDFParameterNotValidException,
 )
-from udf_api.type.type import Type
+from udf.api.type.type import Type
 
 
 class UDFParameterValidator:
diff --git a/udf-py/udf_api/customizer/parameter/udf_parameters.py b/udf-py/udf/api/customizer/parameter/udf_parameters.py
similarity index 98%
rename from udf-py/udf_api/customizer/parameter/udf_parameters.py
rename to udf-py/udf/api/customizer/parameter/udf_parameters.py
index 90fc64c05b..4294da1652 100644
--- a/udf-py/udf_api/customizer/parameter/udf_parameters.py
+++ b/udf-py/udf/api/customizer/parameter/udf_parameters.py
@@ -17,7 +17,7 @@
 
 from typing import Dict, List
 
-from udf_api.type.type import Type
+from udf.api.type.type import Type
 
 
 # Used in UDTF#beforeStart(UDFParameters, UDTFConfigurations).
diff --git a/udf-py/udf_api/exception/__init__.py b/udf-py/udf/api/customizer/strategy/__init__.py
similarity index 100%
rename from udf-py/udf_api/exception/__init__.py
rename to udf-py/udf/api/customizer/strategy/__init__.py
diff --git a/udf-py/udf_api/customizer/strategy/access_strategy.py b/udf-py/udf/api/customizer/strategy/access_strategy.py
similarity index 95%
rename from udf-py/udf_api/customizer/strategy/access_strategy.py
rename to udf-py/udf/api/customizer/strategy/access_strategy.py
index 007aba9ce8..0ea5dccc25 100644
--- a/udf-py/udf_api/customizer/strategy/access_strategy.py
+++ b/udf-py/udf/api/customizer/strategy/access_strategy.py
@@ -17,7 +17,7 @@
 
 from abc import ABCMeta, abstractmethod
 
-from udf_api.customizer.strategy.access_strategy_type import AccessStrategyType
+from udf.api.customizer.strategy.access_strategy_type import AccessStrategyType
 
 
 class AccessStrategy(metaclass=ABCMeta):
diff --git a/udf-py/udf_api/customizer/strategy/access_strategy_type.py b/udf-py/udf/api/customizer/strategy/access_strategy_type.py
similarity index 100%
rename from udf-py/udf_api/customizer/strategy/access_strategy_type.py
rename to udf-py/udf/api/customizer/strategy/access_strategy_type.py
diff --git a/udf-py/udf_api/customizer/strategy/row_by_row_access_strategy.py b/udf-py/udf/api/customizer/strategy/row_by_row_access_strategy.py
similarity index 92%
rename from udf-py/udf_api/customizer/strategy/row_by_row_access_strategy.py
rename to udf-py/udf/api/customizer/strategy/row_by_row_access_strategy.py
index 39a272a276..f1c97270a8 100644
--- a/udf-py/udf_api/customizer/strategy/row_by_row_access_strategy.py
+++ b/udf-py/udf/api/customizer/strategy/row_by_row_access_strategy.py
@@ -15,8 +15,8 @@
 # specific language governing permissions and limitations
 # under the License.
 
-from udf_api.customizer.strategy.access_strategy import AccessStrategy
-from udf_api.customizer.strategy.access_strategy_type import AccessStrategyType
+from udf.api.customizer.strategy.access_strategy import AccessStrategy
+from udf.api.customizer.strategy.access_strategy_type import AccessStrategyType
 
 
 class RowByRowAccessStrategy(AccessStrategy):
diff --git a/udf-py/udf_api/customizer/strategy/session_time_window_access_strategy.py b/udf-py/udf/api/customizer/strategy/session_time_window_access_strategy.py
similarity index 93%
rename from udf-py/udf_api/customizer/strategy/session_time_window_access_strategy.py
rename to udf-py/udf/api/customizer/strategy/session_time_window_access_strategy.py
index b9d2bb72b1..3992342271 100644
--- a/udf-py/udf_api/customizer/strategy/session_time_window_access_strategy.py
+++ b/udf-py/udf/api/customizer/strategy/session_time_window_access_strategy.py
@@ -15,9 +15,9 @@
 # specific language governing permissions and limitations
 # under the License.
 
-from udf_api.customizer.strategy.access_strategy import AccessStrategy
-from udf_api.customizer.strategy.access_strategy_type import AccessStrategyType
-from udf_api.exception.udf_exception import UDFException
+from udf.api.customizer.strategy.access_strategy import AccessStrategy
+from udf.api.customizer.strategy.access_strategy_type import AccessStrategyType
+from udf.api.exception.udf_exception import UDFException
 
 
 class SessionTimeWindowAccessStrategy(AccessStrategy):
diff --git a/udf-py/udf_api/customizer/strategy/sliding_size_window_access_strategy.py b/udf-py/udf/api/customizer/strategy/sliding_size_window_access_strategy.py
similarity index 95%
rename from udf-py/udf_api/customizer/strategy/sliding_size_window_access_strategy.py
rename to udf-py/udf/api/customizer/strategy/sliding_size_window_access_strategy.py
index 4f992847e9..37b141503e 100644
--- a/udf-py/udf_api/customizer/strategy/sliding_size_window_access_strategy.py
+++ b/udf-py/udf/api/customizer/strategy/sliding_size_window_access_strategy.py
@@ -15,9 +15,9 @@
 # specific language governing permissions and limitations
 # under the License.
 
-from udf_api.customizer.strategy.access_strategy import AccessStrategy
-from udf_api.customizer.strategy.access_strategy_type import AccessStrategyType
-from udf_api.exception.udf_exception import UDFException
+from udf.api.customizer.strategy.access_strategy import AccessStrategy
+from udf.api.customizer.strategy.access_strategy_type import AccessStrategyType
+from udf.api.exception.udf_exception import UDFException
 
 
 class SlidingSizeWindowAccessStrategy(AccessStrategy):
diff --git a/udf-py/udf_api/customizer/strategy/sliding_time_window_access_strategy.py b/udf-py/udf/api/customizer/strategy/sliding_time_window_access_strategy.py
similarity index 96%
rename from udf-py/udf_api/customizer/strategy/sliding_time_window_access_strategy.py
rename to udf-py/udf/api/customizer/strategy/sliding_time_window_access_strategy.py
index 3aaaecc4b6..1ff474036b 100644
--- a/udf-py/udf_api/customizer/strategy/sliding_time_window_access_strategy.py
+++ b/udf-py/udf/api/customizer/strategy/sliding_time_window_access_strategy.py
@@ -15,9 +15,9 @@
 # specific language governing permissions and limitations
 # under the License.
 
-from udf_api.customizer.strategy.access_strategy import AccessStrategy
-from udf_api.customizer.strategy.access_strategy_type import AccessStrategyType
-from udf_api.exception.udf_exception import UDFException
+from udf.api.customizer.strategy.access_strategy import AccessStrategy
+from udf.api.customizer.strategy.access_strategy_type import AccessStrategyType
+from udf.api.exception.udf_exception import UDFException
 
 
 class SlidingTimeWindowAccessStrategy(AccessStrategy):
diff --git a/udf-py/udf_api/customizer/strategy/state_window_access_strategy.py b/udf-py/udf/api/customizer/strategy/state_window_access_strategy.py
similarity index 93%
rename from udf-py/udf_api/customizer/strategy/state_window_access_strategy.py
rename to udf-py/udf/api/customizer/strategy/state_window_access_strategy.py
index fb6d35b142..fb5d7b422e 100644
--- a/udf-py/udf_api/customizer/strategy/state_window_access_strategy.py
+++ b/udf-py/udf/api/customizer/strategy/state_window_access_strategy.py
@@ -15,9 +15,9 @@
 # specific language governing permissions and limitations
 # under the License.
 
-from udf_api.customizer.strategy.access_strategy import AccessStrategy
-from udf_api.customizer.strategy.access_strategy_type import AccessStrategyType
-from udf_api.exception.udf_exception import UDFException
+from udf.api.customizer.strategy.access_strategy import AccessStrategy
+from udf.api.customizer.strategy.access_strategy_type import AccessStrategyType
+from udf.api.exception.udf_exception import UDFException
 
 
 class StateWindowAccessStrategy(AccessStrategy):
diff --git a/udf-py/udf_api/type/__init__.py b/udf-py/udf/api/exception/__init__.py
similarity index 100%
rename from udf-py/udf_api/type/__init__.py
rename to udf-py/udf/api/exception/__init__.py
diff --git a/udf-py/udf_api/exception/udf_attribute_not_provided_exception.py b/udf-py/udf/api/exception/udf_attribute_not_provided_exception.py
similarity index 94%
rename from udf-py/udf_api/exception/udf_attribute_not_provided_exception.py
rename to udf-py/udf/api/exception/udf_attribute_not_provided_exception.py
index 7ffc44c181..011a69c5d5 100644
--- a/udf-py/udf_api/exception/udf_attribute_not_provided_exception.py
+++ b/udf-py/udf/api/exception/udf_attribute_not_provided_exception.py
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-from udf_api.exception.udf_parameter_not_valid_exception import (
+from udf.api.exception.udf_parameter_not_valid_exception import (
     UDFParameterNotValidException,
 )
 
diff --git a/udf-py/udf_api/exception/udf_exception.py b/udf-py/udf/api/exception/udf_exception.py
similarity index 100%
rename from udf-py/udf_api/exception/udf_exception.py
rename to udf-py/udf/api/exception/udf_exception.py
diff --git a/udf-py/udf_api/exception/udf_input_series_data_type_not_valid_exception.py b/udf-py/udf/api/exception/udf_input_series_data_type_not_valid_exception.py
similarity index 92%
rename from udf-py/udf_api/exception/udf_input_series_data_type_not_valid_exception.py
rename to udf-py/udf/api/exception/udf_input_series_data_type_not_valid_exception.py
index d7c4bbea1a..2a2be78639 100644
--- a/udf-py/udf_api/exception/udf_input_series_data_type_not_valid_exception.py
+++ b/udf-py/udf/api/exception/udf_input_series_data_type_not_valid_exception.py
@@ -17,10 +17,10 @@
 
 from typing import List
 
-from udf_api.exception.udf_parameter_not_valid_exception import (
+from udf.api.exception.udf_parameter_not_valid_exception import (
     UDFParameterNotValidException,
 )
-from udf_api.type.type import Type
+from udf.api.type.type import Type
 
 
 class UDFInputSeriesDataTypeNotValidException(UDFParameterNotValidException):
diff --git a/udf-py/udf_api/exception/udf_input_series_index_not_valid_exception.py b/udf-py/udf/api/exception/udf_input_series_index_not_valid_exception.py
similarity index 94%
rename from udf-py/udf_api/exception/udf_input_series_index_not_valid_exception.py
rename to udf-py/udf/api/exception/udf_input_series_index_not_valid_exception.py
index 8fe059ca82..64558c7699 100644
--- a/udf-py/udf_api/exception/udf_input_series_index_not_valid_exception.py
+++ b/udf-py/udf/api/exception/udf_input_series_index_not_valid_exception.py
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-from udf_api.exception.udf_parameter_not_valid_exception import (
+from udf.api.exception.udf_parameter_not_valid_exception import (
     UDFParameterNotValidException,
 )
 
diff --git a/udf-py/udf_api/exception/udf_input_series_number_not_valid_exception.py b/udf-py/udf/api/exception/udf_input_series_number_not_valid_exception.py
similarity index 95%
rename from udf-py/udf_api/exception/udf_input_series_number_not_valid_exception.py
rename to udf-py/udf/api/exception/udf_input_series_number_not_valid_exception.py
index 25287fde64..99221a1e34 100644
--- a/udf-py/udf_api/exception/udf_input_series_number_not_valid_exception.py
+++ b/udf-py/udf/api/exception/udf_input_series_number_not_valid_exception.py
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-from udf_api.exception.udf_parameter_not_valid_exception import (
+from udf.api.exception.udf_parameter_not_valid_exception import (
     UDFParameterNotValidException,
 )
 
diff --git a/udf-py/udf_api/exception/udf_management_exception.py b/udf-py/udf/api/exception/udf_management_exception.py
similarity index 94%
rename from udf-py/udf_api/exception/udf_management_exception.py
rename to udf-py/udf/api/exception/udf_management_exception.py
index cc3165a617..26cc79ad69 100644
--- a/udf-py/udf_api/exception/udf_management_exception.py
+++ b/udf-py/udf/api/exception/udf_management_exception.py
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-from udf_api.exception.udf_exception import UDFException
+from udf.api.exception.udf_exception import UDFException
 
 
 class UDFManagementException(UDFException):
diff --git a/udf-py/udf_api/exception/udf_output_series_data_type_not_valid_exception.py b/udf-py/udf/api/exception/udf_output_series_data_type_not_valid_exception.py
similarity index 94%
rename from udf-py/udf_api/exception/udf_output_series_data_type_not_valid_exception.py
rename to udf-py/udf/api/exception/udf_output_series_data_type_not_valid_exception.py
index c2ef7146a9..7982993f22 100644
--- a/udf-py/udf_api/exception/udf_output_series_data_type_not_valid_exception.py
+++ b/udf-py/udf/api/exception/udf_output_series_data_type_not_valid_exception.py
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-from udf_api.exception.udf_parameter_not_valid_exception import (
+from udf.api.exception.udf_parameter_not_valid_exception import (
     UDFParameterNotValidException,
 )
 
diff --git a/udf-py/udf_api/exception/udf_parameter_not_valid_exception.py b/udf-py/udf/api/exception/udf_parameter_not_valid_exception.py
similarity index 94%
rename from udf-py/udf_api/exception/udf_parameter_not_valid_exception.py
rename to udf-py/udf/api/exception/udf_parameter_not_valid_exception.py
index 69279acf90..90d2c4ce97 100644
--- a/udf-py/udf_api/exception/udf_parameter_not_valid_exception.py
+++ b/udf-py/udf/api/exception/udf_parameter_not_valid_exception.py
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-from udf_api.exception.udf_exception import UDFException
+from udf.api.exception.udf_exception import UDFException
 
 
 class UDFParameterNotValidException(UDFException):
diff --git a/udf-py/udf_runtime/__init__.py b/udf-py/udf/api/type/__init__.py
similarity index 100%
rename from udf-py/udf_runtime/__init__.py
rename to udf-py/udf/api/type/__init__.py
diff --git a/udf-py/udf_api/type/binary.py b/udf-py/udf/api/type/binary.py
similarity index 100%
rename from udf-py/udf_api/type/binary.py
rename to udf-py/udf/api/type/binary.py
diff --git a/udf-py/udf_api/type/type.py b/udf-py/udf/api/type/type.py
similarity index 100%
rename from udf-py/udf_api/type/type.py
rename to udf-py/udf/api/type/type.py
diff --git a/udf-py/udf_api/udf.py b/udf-py/udf/api/udf.py
similarity index 95%
rename from udf-py/udf_api/udf.py
rename to udf-py/udf/api/udf.py
index 22bbaa1e25..d355141c2b 100644
--- a/udf-py/udf_api/udf.py
+++ b/udf-py/udf/api/udf.py
@@ -17,7 +17,7 @@
 
 from abc import ABCMeta
 
-from udf_api.customizer.parameter.udf_parameter_validator import UDFParameterValidator
+from udf.api.customizer.parameter.udf_parameter_validator import UDFParameterValidator
 
 
 class UDF(metaclass=ABCMeta):
diff --git a/udf-py/udf_api/udtf.py b/udf-py/udf/api/udtf.py
similarity index 93%
rename from udf-py/udf_api/udtf.py
rename to udf-py/udf/api/udtf.py
index 9c1bf4dbf7..8cd7c3c2e1 100644
--- a/udf-py/udf_api/udtf.py
+++ b/udf-py/udf/api/udtf.py
@@ -16,12 +16,12 @@
 # under the License.
 from abc import abstractmethod
 
-from udf_api.access.row import Row
-from udf_api.access.row_window import RowWindow
-from udf_api.collector.point_collector import PointCollector
-from udf_api.customizer.config.udtf_configurations import UDTFConfigurations
-from udf_api.customizer.parameter.udf_parameters import UDFParameters
-from udf_api.udf import UDF
+from udf.api.access.row import Row
+from udf.api.access.row_window import RowWindow
+from udf.api.collector.point_collector import PointCollector
+from udf.api.customizer.config.udtf_configurations import UDTFConfigurations
+from udf.api.customizer.parameter.udf_parameters import UDFParameters
+from udf.api.udf import UDF
 
 
 class UDTF(UDF):
diff --git a/udf-py/udf_api/__init__.py b/udf-py/udf/runtime/__init__.py
similarity index 100%
rename from udf-py/udf_api/__init__.py
rename to udf-py/udf/runtime/__init__.py


[iotdb] 03/04: refactor udf package

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rong pushed a commit to branch IOTDB-5195
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit ba611576e0e86347d37b2cd3022b0671b27d17f7
Author: Steve Yurong Su <ro...@apache.org>
AuthorDate: Wed Dec 14 05:02:27 2022 +0800

    refactor udf package
---
 udf-py/{udf => iotdb}/__init__.py                          |  0
 udf-py/{udf/api => iotdb/udf}/__init__.py                  |  0
 udf-py/{udf/api/access => iotdb/udf/api}/__init__.py       |  0
 .../api/collector => iotdb/udf/api/access}/__init__.py     |  0
 udf-py/{ => iotdb}/udf/api/access/row.py                   |  4 ++--
 udf-py/{ => iotdb}/udf/api/access/row_iterator.py          |  0
 udf-py/{ => iotdb}/udf/api/access/row_window.py            |  6 +++---
 .../api/customizer => iotdb/udf/api/collector}/__init__.py |  0
 udf-py/{ => iotdb}/udf/api/collector/point_collector.py    |  2 +-
 .../config => iotdb/udf/api/customizer}/__init__.py        |  0
 .../udf/api/customizer/config}/__init__.py                 |  0
 .../udf/api/customizer/config/udf_configurations.py        |  4 ++--
 .../udf/api/customizer/config/udtf_configurations.py       |  8 ++++----
 .../udf/api/customizer/parameter}/__init__.py              |  0
 .../api/customizer/parameter/udf_parameter_validator.py    | 14 +++++++-------
 .../udf/api/customizer/parameter/udf_parameters.py         |  2 +-
 .../udf/api/customizer/strategy}/__init__.py               |  0
 .../udf/api/customizer/strategy/access_strategy.py         |  2 +-
 .../udf/api/customizer/strategy/access_strategy_type.py    |  0
 .../api/customizer/strategy/row_by_row_access_strategy.py  |  4 ++--
 .../strategy/session_time_window_access_strategy.py        |  6 +++---
 .../strategy/sliding_size_window_access_strategy.py        |  6 +++---
 .../strategy/sliding_time_window_access_strategy.py        |  6 +++---
 .../customizer/strategy/state_window_access_strategy.py    |  6 +++---
 .../{udf/api/type => iotdb/udf/api/exception}/__init__.py  |  0
 .../api/exception/udf_attribute_not_provided_exception.py  |  2 +-
 udf-py/{ => iotdb}/udf/api/exception/udf_exception.py      |  0
 .../udf_input_series_data_type_not_valid_exception.py      |  4 ++--
 .../udf_input_series_index_not_valid_exception.py          |  2 +-
 .../udf_input_series_number_not_valid_exception.py         |  2 +-
 .../udf/api/exception/udf_management_exception.py          |  2 +-
 .../udf_output_series_data_type_not_valid_exception.py     |  2 +-
 .../udf/api/exception/udf_parameter_not_valid_exception.py |  2 +-
 udf-py/{udf/runtime => iotdb/udf/api/type}/__init__.py     |  0
 udf-py/{ => iotdb}/udf/api/type/binary.py                  |  0
 udf-py/{ => iotdb}/udf/api/type/type.py                    |  0
 udf-py/{ => iotdb}/udf/api/udf.py                          |  4 +++-
 udf-py/{ => iotdb}/udf/api/udtf.py                         | 12 ++++++------
 udf-py/{udf => iotdb/udf/runtime}/__init__.py              |  0
 udf-py/setup.py                                            |  4 ++--
 40 files changed, 54 insertions(+), 52 deletions(-)

diff --git a/udf-py/udf/__init__.py b/udf-py/iotdb/__init__.py
similarity index 100%
copy from udf-py/udf/__init__.py
copy to udf-py/iotdb/__init__.py
diff --git a/udf-py/udf/api/__init__.py b/udf-py/iotdb/udf/__init__.py
similarity index 100%
rename from udf-py/udf/api/__init__.py
rename to udf-py/iotdb/udf/__init__.py
diff --git a/udf-py/udf/api/access/__init__.py b/udf-py/iotdb/udf/api/__init__.py
similarity index 100%
rename from udf-py/udf/api/access/__init__.py
rename to udf-py/iotdb/udf/api/__init__.py
diff --git a/udf-py/udf/api/collector/__init__.py b/udf-py/iotdb/udf/api/access/__init__.py
similarity index 100%
rename from udf-py/udf/api/collector/__init__.py
rename to udf-py/iotdb/udf/api/access/__init__.py
diff --git a/udf-py/udf/api/access/row.py b/udf-py/iotdb/udf/api/access/row.py
similarity index 97%
rename from udf-py/udf/api/access/row.py
rename to udf-py/iotdb/udf/api/access/row.py
index 781de785ea..bcc73eec20 100644
--- a/udf-py/udf/api/access/row.py
+++ b/udf-py/iotdb/udf/api/access/row.py
@@ -17,8 +17,8 @@
 
 from abc import ABCMeta, abstractmethod
 
-from udf.api.type.binary import Binary
-from udf.api.type.type import Type
+from iotdb.udf.api.type.binary import Binary
+from iotdb.udf.api.type.type import Type
 
 
 class Row(metaclass=ABCMeta):
diff --git a/udf-py/udf/api/access/row_iterator.py b/udf-py/iotdb/udf/api/access/row_iterator.py
similarity index 100%
rename from udf-py/udf/api/access/row_iterator.py
rename to udf-py/iotdb/udf/api/access/row_iterator.py
diff --git a/udf-py/udf/api/access/row_window.py b/udf-py/iotdb/udf/api/access/row_window.py
similarity index 96%
rename from udf-py/udf/api/access/row_window.py
rename to udf-py/iotdb/udf/api/access/row_window.py
index 321fbd65da..691dc0e9e6 100644
--- a/udf-py/udf/api/access/row_window.py
+++ b/udf-py/iotdb/udf/api/access/row_window.py
@@ -18,9 +18,9 @@
 
 from abc import ABCMeta, abstractmethod
 
-from udf.api.access.row import Row
-from udf.api.access.row_iterator import RowIterator
-from udf.api.type.type import Type
+from iotdb.udf.api.access.row import Row
+from iotdb.udf.api.access.row_iterator import RowIterator
+from iotdb.udf.api.type.type import Type
 
 
 class RowWindow(metaclass=ABCMeta):
diff --git a/udf-py/udf/api/customizer/__init__.py b/udf-py/iotdb/udf/api/collector/__init__.py
similarity index 100%
rename from udf-py/udf/api/customizer/__init__.py
rename to udf-py/iotdb/udf/api/collector/__init__.py
diff --git a/udf-py/udf/api/collector/point_collector.py b/udf-py/iotdb/udf/api/collector/point_collector.py
similarity index 98%
rename from udf-py/udf/api/collector/point_collector.py
rename to udf-py/iotdb/udf/api/collector/point_collector.py
index 9143917c94..74e791206e 100644
--- a/udf-py/udf/api/collector/point_collector.py
+++ b/udf-py/iotdb/udf/api/collector/point_collector.py
@@ -17,7 +17,7 @@
 
 from abc import ABCMeta, abstractmethod
 
-from udf.api.type.binary import Binary
+from iotdb.udf.api.type.binary import Binary
 
 
 class PointCollector(metaclass=ABCMeta):
diff --git a/udf-py/udf/api/customizer/config/__init__.py b/udf-py/iotdb/udf/api/customizer/__init__.py
similarity index 100%
rename from udf-py/udf/api/customizer/config/__init__.py
rename to udf-py/iotdb/udf/api/customizer/__init__.py
diff --git a/udf-py/udf/api/customizer/parameter/__init__.py b/udf-py/iotdb/udf/api/customizer/config/__init__.py
similarity index 100%
rename from udf-py/udf/api/customizer/parameter/__init__.py
rename to udf-py/iotdb/udf/api/customizer/config/__init__.py
diff --git a/udf-py/udf/api/customizer/config/udf_configurations.py b/udf-py/iotdb/udf/api/customizer/config/udf_configurations.py
similarity index 91%
rename from udf-py/udf/api/customizer/config/udf_configurations.py
rename to udf-py/iotdb/udf/api/customizer/config/udf_configurations.py
index 5385590075..f89430470e 100644
--- a/udf-py/udf/api/customizer/config/udf_configurations.py
+++ b/udf-py/iotdb/udf/api/customizer/config/udf_configurations.py
@@ -17,8 +17,8 @@
 
 from abc import ABCMeta
 
-from udf.api.exception.udf_exception import UDFException
-from udf.api.type.type import Type
+from iotdb.udf.api.exception.udf_exception import UDFException
+from iotdb.udf.api.type.type import Type
 
 
 class UDFConfigurations(metaclass=ABCMeta):
diff --git a/udf-py/udf/api/customizer/config/udtf_configurations.py b/udf-py/iotdb/udf/api/customizer/config/udtf_configurations.py
similarity index 89%
rename from udf-py/udf/api/customizer/config/udtf_configurations.py
rename to udf-py/iotdb/udf/api/customizer/config/udtf_configurations.py
index b9aeb32ed2..17f4728b51 100644
--- a/udf-py/udf/api/customizer/config/udtf_configurations.py
+++ b/udf-py/iotdb/udf/api/customizer/config/udtf_configurations.py
@@ -15,10 +15,10 @@
 # specific language governing permissions and limitations
 # under the License.
 
-from udf.api.customizer import UDFConfigurations
-from udf.api.customizer import AccessStrategy
-from udf.api.exception import UDFException
-from udf.api.type import Type
+from iotdb.udf.api.customizer.config.udf_configurations import UDFConfigurations
+from iotdb.udf.api.customizer.strategy.access_strategy import AccessStrategy
+from iotdb.udf.api.exception.udf_exception import UDFException
+from iotdb.udf.api.type.type import Type
 
 
 class UDTFConfigurations(UDFConfigurations):
diff --git a/udf-py/udf/api/customizer/strategy/__init__.py b/udf-py/iotdb/udf/api/customizer/parameter/__init__.py
similarity index 100%
rename from udf-py/udf/api/customizer/strategy/__init__.py
rename to udf-py/iotdb/udf/api/customizer/parameter/__init__.py
diff --git a/udf-py/udf/api/customizer/parameter/udf_parameter_validator.py b/udf-py/iotdb/udf/api/customizer/parameter/udf_parameter_validator.py
similarity index 91%
rename from udf-py/udf/api/customizer/parameter/udf_parameter_validator.py
rename to udf-py/iotdb/udf/api/customizer/parameter/udf_parameter_validator.py
index 6b2df67f51..191dda3653 100644
--- a/udf-py/udf/api/customizer/parameter/udf_parameter_validator.py
+++ b/udf-py/iotdb/udf/api/customizer/parameter/udf_parameter_validator.py
@@ -17,23 +17,23 @@
 
 from typing import List
 
-from udf.api.customizer.parameter.udf_parameters import UDFParameters
-from udf.api.exception.udf_attribute_not_provided_exception import (
+from iotdb.udf.api.customizer.parameter.udf_parameters import UDFParameters
+from iotdb.udf.api.exception.udf_attribute_not_provided_exception import (
     UDFAttributeNotProvidedException,
 )
-from udf.api.exception.udf_input_series_data_type_not_valid_exception import (
+from iotdb.udf.api.exception.udf_input_series_data_type_not_valid_exception import (
     UDFInputSeriesDataTypeNotValidException,
 )
-from udf.api.exception.udf_input_series_index_not_valid_exception import (
+from iotdb.udf.api.exception.udf_input_series_index_not_valid_exception import (
     UDFInputSeriesIndexNotValidException,
 )
-from udf.api.exception.udf_input_series_number_not_valid_exception import (
+from iotdb.udf.api.exception.udf_input_series_number_not_valid_exception import (
     UDFInputSeriesNumberNotValidException,
 )
-from udf.api.exception.udf_parameter_not_valid_exception import (
+from iotdb.udf.api.exception.udf_parameter_not_valid_exception import (
     UDFParameterNotValidException,
 )
-from udf.api.type.type import Type
+from iotdb.udf.api.type.type import Type
 
 
 class UDFParameterValidator:
diff --git a/udf-py/udf/api/customizer/parameter/udf_parameters.py b/udf-py/iotdb/udf/api/customizer/parameter/udf_parameters.py
similarity index 98%
rename from udf-py/udf/api/customizer/parameter/udf_parameters.py
rename to udf-py/iotdb/udf/api/customizer/parameter/udf_parameters.py
index 4294da1652..2f99fdfe66 100644
--- a/udf-py/udf/api/customizer/parameter/udf_parameters.py
+++ b/udf-py/iotdb/udf/api/customizer/parameter/udf_parameters.py
@@ -17,7 +17,7 @@
 
 from typing import Dict, List
 
-from udf.api.type.type import Type
+from iotdb.udf.api.type.type import Type
 
 
 # Used in UDTF#beforeStart(UDFParameters, UDTFConfigurations).
diff --git a/udf-py/udf/api/exception/__init__.py b/udf-py/iotdb/udf/api/customizer/strategy/__init__.py
similarity index 100%
rename from udf-py/udf/api/exception/__init__.py
rename to udf-py/iotdb/udf/api/customizer/strategy/__init__.py
diff --git a/udf-py/udf/api/customizer/strategy/access_strategy.py b/udf-py/iotdb/udf/api/customizer/strategy/access_strategy.py
similarity index 94%
rename from udf-py/udf/api/customizer/strategy/access_strategy.py
rename to udf-py/iotdb/udf/api/customizer/strategy/access_strategy.py
index 0ea5dccc25..f6e772b611 100644
--- a/udf-py/udf/api/customizer/strategy/access_strategy.py
+++ b/udf-py/iotdb/udf/api/customizer/strategy/access_strategy.py
@@ -17,7 +17,7 @@
 
 from abc import ABCMeta, abstractmethod
 
-from udf.api.customizer.strategy.access_strategy_type import AccessStrategyType
+from iotdb.udf.api.customizer.strategy.access_strategy_type import AccessStrategyType
 
 
 class AccessStrategy(metaclass=ABCMeta):
diff --git a/udf-py/udf/api/customizer/strategy/access_strategy_type.py b/udf-py/iotdb/udf/api/customizer/strategy/access_strategy_type.py
similarity index 100%
rename from udf-py/udf/api/customizer/strategy/access_strategy_type.py
rename to udf-py/iotdb/udf/api/customizer/strategy/access_strategy_type.py
diff --git a/udf-py/udf/api/customizer/strategy/row_by_row_access_strategy.py b/udf-py/iotdb/udf/api/customizer/strategy/row_by_row_access_strategy.py
similarity index 90%
rename from udf-py/udf/api/customizer/strategy/row_by_row_access_strategy.py
rename to udf-py/iotdb/udf/api/customizer/strategy/row_by_row_access_strategy.py
index f1c97270a8..a8e72aae30 100644
--- a/udf-py/udf/api/customizer/strategy/row_by_row_access_strategy.py
+++ b/udf-py/iotdb/udf/api/customizer/strategy/row_by_row_access_strategy.py
@@ -15,8 +15,8 @@
 # specific language governing permissions and limitations
 # under the License.
 
-from udf.api.customizer.strategy.access_strategy import AccessStrategy
-from udf.api.customizer.strategy.access_strategy_type import AccessStrategyType
+from iotdb.udf.api.customizer.strategy.access_strategy import AccessStrategy
+from iotdb.udf.api.customizer.strategy.access_strategy_type import AccessStrategyType
 
 
 class RowByRowAccessStrategy(AccessStrategy):
diff --git a/udf-py/udf/api/customizer/strategy/session_time_window_access_strategy.py b/udf-py/iotdb/udf/api/customizer/strategy/session_time_window_access_strategy.py
similarity index 92%
rename from udf-py/udf/api/customizer/strategy/session_time_window_access_strategy.py
rename to udf-py/iotdb/udf/api/customizer/strategy/session_time_window_access_strategy.py
index 3992342271..4dbeb5b4a3 100644
--- a/udf-py/udf/api/customizer/strategy/session_time_window_access_strategy.py
+++ b/udf-py/iotdb/udf/api/customizer/strategy/session_time_window_access_strategy.py
@@ -15,9 +15,9 @@
 # specific language governing permissions and limitations
 # under the License.
 
-from udf.api.customizer.strategy.access_strategy import AccessStrategy
-from udf.api.customizer.strategy.access_strategy_type import AccessStrategyType
-from udf.api.exception.udf_exception import UDFException
+from iotdb.udf.api.customizer.strategy.access_strategy import AccessStrategy
+from iotdb.udf.api.customizer.strategy.access_strategy_type import AccessStrategyType
+from iotdb.udf.api.exception.udf_exception import UDFException
 
 
 class SessionTimeWindowAccessStrategy(AccessStrategy):
diff --git a/udf-py/udf/api/customizer/strategy/sliding_size_window_access_strategy.py b/udf-py/iotdb/udf/api/customizer/strategy/sliding_size_window_access_strategy.py
similarity index 94%
rename from udf-py/udf/api/customizer/strategy/sliding_size_window_access_strategy.py
rename to udf-py/iotdb/udf/api/customizer/strategy/sliding_size_window_access_strategy.py
index 37b141503e..965f5bcdbe 100644
--- a/udf-py/udf/api/customizer/strategy/sliding_size_window_access_strategy.py
+++ b/udf-py/iotdb/udf/api/customizer/strategy/sliding_size_window_access_strategy.py
@@ -15,9 +15,9 @@
 # specific language governing permissions and limitations
 # under the License.
 
-from udf.api.customizer.strategy.access_strategy import AccessStrategy
-from udf.api.customizer.strategy.access_strategy_type import AccessStrategyType
-from udf.api.exception.udf_exception import UDFException
+from iotdb.udf.api.customizer.strategy.access_strategy import AccessStrategy
+from iotdb.udf.api.customizer.strategy.access_strategy_type import AccessStrategyType
+from iotdb.udf.api.exception.udf_exception import UDFException
 
 
 class SlidingSizeWindowAccessStrategy(AccessStrategy):
diff --git a/udf-py/udf/api/customizer/strategy/sliding_time_window_access_strategy.py b/udf-py/iotdb/udf/api/customizer/strategy/sliding_time_window_access_strategy.py
similarity index 95%
rename from udf-py/udf/api/customizer/strategy/sliding_time_window_access_strategy.py
rename to udf-py/iotdb/udf/api/customizer/strategy/sliding_time_window_access_strategy.py
index 1ff474036b..6f57a63ae5 100644
--- a/udf-py/udf/api/customizer/strategy/sliding_time_window_access_strategy.py
+++ b/udf-py/iotdb/udf/api/customizer/strategy/sliding_time_window_access_strategy.py
@@ -15,9 +15,9 @@
 # specific language governing permissions and limitations
 # under the License.
 
-from udf.api.customizer.strategy.access_strategy import AccessStrategy
-from udf.api.customizer.strategy.access_strategy_type import AccessStrategyType
-from udf.api.exception.udf_exception import UDFException
+from iotdb.udf.api.customizer.strategy.access_strategy import AccessStrategy
+from iotdb.udf.api.customizer.strategy.access_strategy_type import AccessStrategyType
+from iotdb.udf.api.exception.udf_exception import UDFException
 
 
 class SlidingTimeWindowAccessStrategy(AccessStrategy):
diff --git a/udf-py/udf/api/customizer/strategy/state_window_access_strategy.py b/udf-py/iotdb/udf/api/customizer/strategy/state_window_access_strategy.py
similarity index 92%
rename from udf-py/udf/api/customizer/strategy/state_window_access_strategy.py
rename to udf-py/iotdb/udf/api/customizer/strategy/state_window_access_strategy.py
index fb5d7b422e..26ef3cecbf 100644
--- a/udf-py/udf/api/customizer/strategy/state_window_access_strategy.py
+++ b/udf-py/iotdb/udf/api/customizer/strategy/state_window_access_strategy.py
@@ -15,9 +15,9 @@
 # specific language governing permissions and limitations
 # under the License.
 
-from udf.api.customizer.strategy.access_strategy import AccessStrategy
-from udf.api.customizer.strategy.access_strategy_type import AccessStrategyType
-from udf.api.exception.udf_exception import UDFException
+from iotdb.udf.api.customizer.strategy.access_strategy import AccessStrategy
+from iotdb.udf.api.customizer.strategy.access_strategy_type import AccessStrategyType
+from iotdb.udf.api.exception.udf_exception import UDFException
 
 
 class StateWindowAccessStrategy(AccessStrategy):
diff --git a/udf-py/udf/api/type/__init__.py b/udf-py/iotdb/udf/api/exception/__init__.py
similarity index 100%
rename from udf-py/udf/api/type/__init__.py
rename to udf-py/iotdb/udf/api/exception/__init__.py
diff --git a/udf-py/udf/api/exception/udf_attribute_not_provided_exception.py b/udf-py/iotdb/udf/api/exception/udf_attribute_not_provided_exception.py
similarity index 93%
rename from udf-py/udf/api/exception/udf_attribute_not_provided_exception.py
rename to udf-py/iotdb/udf/api/exception/udf_attribute_not_provided_exception.py
index 011a69c5d5..613baf1aa2 100644
--- a/udf-py/udf/api/exception/udf_attribute_not_provided_exception.py
+++ b/udf-py/iotdb/udf/api/exception/udf_attribute_not_provided_exception.py
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-from udf.api.exception.udf_parameter_not_valid_exception import (
+from iotdb.udf.api.exception.udf_parameter_not_valid_exception import (
     UDFParameterNotValidException,
 )
 
diff --git a/udf-py/udf/api/exception/udf_exception.py b/udf-py/iotdb/udf/api/exception/udf_exception.py
similarity index 100%
rename from udf-py/udf/api/exception/udf_exception.py
rename to udf-py/iotdb/udf/api/exception/udf_exception.py
diff --git a/udf-py/udf/api/exception/udf_input_series_data_type_not_valid_exception.py b/udf-py/iotdb/udf/api/exception/udf_input_series_data_type_not_valid_exception.py
similarity index 91%
rename from udf-py/udf/api/exception/udf_input_series_data_type_not_valid_exception.py
rename to udf-py/iotdb/udf/api/exception/udf_input_series_data_type_not_valid_exception.py
index 2a2be78639..d5e57314ff 100644
--- a/udf-py/udf/api/exception/udf_input_series_data_type_not_valid_exception.py
+++ b/udf-py/iotdb/udf/api/exception/udf_input_series_data_type_not_valid_exception.py
@@ -17,10 +17,10 @@
 
 from typing import List
 
-from udf.api.exception.udf_parameter_not_valid_exception import (
+from iotdb.udf.api.exception.udf_parameter_not_valid_exception import (
     UDFParameterNotValidException,
 )
-from udf.api.type.type import Type
+from iotdb.udf.api.type.type import Type
 
 
 class UDFInputSeriesDataTypeNotValidException(UDFParameterNotValidException):
diff --git a/udf-py/udf/api/exception/udf_input_series_index_not_valid_exception.py b/udf-py/iotdb/udf/api/exception/udf_input_series_index_not_valid_exception.py
similarity index 94%
rename from udf-py/udf/api/exception/udf_input_series_index_not_valid_exception.py
rename to udf-py/iotdb/udf/api/exception/udf_input_series_index_not_valid_exception.py
index 64558c7699..4917cceed8 100644
--- a/udf-py/udf/api/exception/udf_input_series_index_not_valid_exception.py
+++ b/udf-py/iotdb/udf/api/exception/udf_input_series_index_not_valid_exception.py
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-from udf.api.exception.udf_parameter_not_valid_exception import (
+from iotdb.udf.api.exception.udf_parameter_not_valid_exception import (
     UDFParameterNotValidException,
 )
 
diff --git a/udf-py/udf/api/exception/udf_input_series_number_not_valid_exception.py b/udf-py/iotdb/udf/api/exception/udf_input_series_number_not_valid_exception.py
similarity index 95%
rename from udf-py/udf/api/exception/udf_input_series_number_not_valid_exception.py
rename to udf-py/iotdb/udf/api/exception/udf_input_series_number_not_valid_exception.py
index 99221a1e34..4443616c51 100644
--- a/udf-py/udf/api/exception/udf_input_series_number_not_valid_exception.py
+++ b/udf-py/iotdb/udf/api/exception/udf_input_series_number_not_valid_exception.py
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-from udf.api.exception.udf_parameter_not_valid_exception import (
+from iotdb.udf.api.exception.udf_parameter_not_valid_exception import (
     UDFParameterNotValidException,
 )
 
diff --git a/udf-py/udf/api/exception/udf_management_exception.py b/udf-py/iotdb/udf/api/exception/udf_management_exception.py
similarity index 93%
rename from udf-py/udf/api/exception/udf_management_exception.py
rename to udf-py/iotdb/udf/api/exception/udf_management_exception.py
index 26cc79ad69..46cc353ec2 100644
--- a/udf-py/udf/api/exception/udf_management_exception.py
+++ b/udf-py/iotdb/udf/api/exception/udf_management_exception.py
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-from udf.api.exception.udf_exception import UDFException
+from iotdb.udf.api.exception.udf_exception import UDFException
 
 
 class UDFManagementException(UDFException):
diff --git a/udf-py/udf/api/exception/udf_output_series_data_type_not_valid_exception.py b/udf-py/iotdb/udf/api/exception/udf_output_series_data_type_not_valid_exception.py
similarity index 94%
rename from udf-py/udf/api/exception/udf_output_series_data_type_not_valid_exception.py
rename to udf-py/iotdb/udf/api/exception/udf_output_series_data_type_not_valid_exception.py
index 7982993f22..2b3a634503 100644
--- a/udf-py/udf/api/exception/udf_output_series_data_type_not_valid_exception.py
+++ b/udf-py/iotdb/udf/api/exception/udf_output_series_data_type_not_valid_exception.py
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-from udf.api.exception.udf_parameter_not_valid_exception import (
+from iotdb.udf.api.exception.udf_parameter_not_valid_exception import (
     UDFParameterNotValidException,
 )
 
diff --git a/udf-py/udf/api/exception/udf_parameter_not_valid_exception.py b/udf-py/iotdb/udf/api/exception/udf_parameter_not_valid_exception.py
similarity index 93%
rename from udf-py/udf/api/exception/udf_parameter_not_valid_exception.py
rename to udf-py/iotdb/udf/api/exception/udf_parameter_not_valid_exception.py
index 90d2c4ce97..332d5da597 100644
--- a/udf-py/udf/api/exception/udf_parameter_not_valid_exception.py
+++ b/udf-py/iotdb/udf/api/exception/udf_parameter_not_valid_exception.py
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-from udf.api.exception.udf_exception import UDFException
+from iotdb.udf.api.exception.udf_exception import UDFException
 
 
 class UDFParameterNotValidException(UDFException):
diff --git a/udf-py/udf/runtime/__init__.py b/udf-py/iotdb/udf/api/type/__init__.py
similarity index 100%
rename from udf-py/udf/runtime/__init__.py
rename to udf-py/iotdb/udf/api/type/__init__.py
diff --git a/udf-py/udf/api/type/binary.py b/udf-py/iotdb/udf/api/type/binary.py
similarity index 100%
rename from udf-py/udf/api/type/binary.py
rename to udf-py/iotdb/udf/api/type/binary.py
diff --git a/udf-py/udf/api/type/type.py b/udf-py/iotdb/udf/api/type/type.py
similarity index 100%
rename from udf-py/udf/api/type/type.py
rename to udf-py/iotdb/udf/api/type/type.py
diff --git a/udf-py/udf/api/udf.py b/udf-py/iotdb/udf/api/udf.py
similarity index 92%
rename from udf-py/udf/api/udf.py
rename to udf-py/iotdb/udf/api/udf.py
index d355141c2b..5b61246470 100644
--- a/udf-py/udf/api/udf.py
+++ b/udf-py/iotdb/udf/api/udf.py
@@ -17,7 +17,9 @@
 
 from abc import ABCMeta
 
-from udf.api.customizer.parameter.udf_parameter_validator import UDFParameterValidator
+from iotdb.udf.api.customizer.parameter.udf_parameter_validator import (
+    UDFParameterValidator,
+)
 
 
 class UDF(metaclass=ABCMeta):
diff --git a/udf-py/udf/api/udtf.py b/udf-py/iotdb/udf/api/udtf.py
similarity index 91%
rename from udf-py/udf/api/udtf.py
rename to udf-py/iotdb/udf/api/udtf.py
index 8cd7c3c2e1..773039d0ec 100644
--- a/udf-py/udf/api/udtf.py
+++ b/udf-py/iotdb/udf/api/udtf.py
@@ -16,12 +16,12 @@
 # under the License.
 from abc import abstractmethod
 
-from udf.api.access.row import Row
-from udf.api.access.row_window import RowWindow
-from udf.api.collector.point_collector import PointCollector
-from udf.api.customizer.config.udtf_configurations import UDTFConfigurations
-from udf.api.customizer.parameter.udf_parameters import UDFParameters
-from udf.api.udf import UDF
+from iotdb.udf.api.access.row import Row
+from iotdb.udf.api.access.row_window import RowWindow
+from iotdb.udf.api.collector.point_collector import PointCollector
+from iotdb.udf.api.customizer.config.udtf_configurations import UDTFConfigurations
+from iotdb.udf.api.customizer.parameter.udf_parameters import UDFParameters
+from iotdb.udf.api.udf import UDF
 
 
 class UDTF(UDF):
diff --git a/udf-py/udf/__init__.py b/udf-py/iotdb/udf/runtime/__init__.py
similarity index 100%
rename from udf-py/udf/__init__.py
rename to udf-py/iotdb/udf/runtime/__init__.py
diff --git a/udf-py/setup.py b/udf-py/setup.py
index 79404284c3..a6aed999fc 100644
--- a/udf-py/setup.py
+++ b/udf-py/setup.py
@@ -30,9 +30,9 @@ print(long_description)
 setuptools.setup(
     name="apache-iotdb-udf",
     version="1.0.0",
-    author=" Apache Software Foundation",
+    author="Apache Software Foundation",
     author_email="dev@iotdb.apache.org",
-    description="Apache IoTDB client API",
+    description="Apache IoTDB UDF API",
     long_description=long_description,
     long_description_content_type="text/markdown",
     url="https://github.com/apache/iotdb",


[iotdb] 01/04: basic udf class struct

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rong pushed a commit to branch IOTDB-5195
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 2cd4808462af2a4c882b015031b0b2cb2d056e8a
Author: Steve Yurong Su <ro...@apache.org>
AuthorDate: Wed Dec 14 04:02:09 2022 +0800

    basic udf class struct
---
 .../multi/UniversalUDFQueryTransformer.java        |  2 +-
 .../transformation/dag/udf/base/UDTFExecutor.java  |  5 +-
 .../dag/udf/python/PythonPointCollector.java       | 23 ++++++++
 .../transformation/dag/udf/python/PythonUDTF.java  | 64 ++++++++++++++++++++++
 .../dag/udf/python/PythonUDTFExecutor.java         | 61 +++++++++++++++++++++
 .../dag/udf/python/PythonUDTFPointCollector.java   | 22 ++++++++
 6 files changed, 174 insertions(+), 3 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/multi/UniversalUDFQueryTransformer.java b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/multi/UniversalUDFQueryTransformer.java
index 2927006b40..df2aee45ad 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/multi/UniversalUDFQueryTransformer.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/multi/UniversalUDFQueryTransformer.java
@@ -34,7 +34,7 @@ public abstract class UniversalUDFQueryTransformer extends UDFQueryTransformer {
 
   protected UniversalUDFQueryTransformer(UDTFExecutor executor) {
     super(executor);
-    layerPointReader = executor.getCollector().constructPointReaderUsingTrivialEvictionStrategy();
+    layerPointReader = executor.getPointCollector();
     isLayerPointReaderConstant = layerPointReader.isConstantPointReader();
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/udf/base/UDTFExecutor.java b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/udf/base/UDTFExecutor.java
index cb5c477030..1d739719b7 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/udf/base/UDTFExecutor.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/udf/base/UDTFExecutor.java
@@ -21,6 +21,7 @@ package org.apache.iotdb.db.mpp.transformation.dag.udf.base;
 
 import org.apache.iotdb.commons.udf.service.UDFManagementService;
 import org.apache.iotdb.commons.udf.utils.UDFDataTypeTransformer;
+import org.apache.iotdb.db.mpp.transformation.api.LayerPointReader;
 import org.apache.iotdb.db.mpp.transformation.datastructure.tv.ElasticSerializableTVList;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
 import org.apache.iotdb.udf.api.UDTF;
@@ -160,7 +161,7 @@ public class UDTFExecutor {
     return configurations;
   }
 
-  public ElasticSerializableTVList getCollector() {
-    return collector;
+  public LayerPointReader getPointCollector() {
+    return collector.constructPointReaderUsingTrivialEvictionStrategy();
   }
 }
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/udf/python/PythonPointCollector.java b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/udf/python/PythonPointCollector.java
new file mode 100644
index 0000000000..b43e9f02c3
--- /dev/null
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/udf/python/PythonPointCollector.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.db.mpp.transformation.dag.udf.python;
+
+public class PythonPointCollector {
+}
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/udf/python/PythonUDTF.java b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/udf/python/PythonUDTF.java
new file mode 100644
index 0000000000..96a808bb09
--- /dev/null
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/udf/python/PythonUDTF.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.db.mpp.transformation.dag.udf.python;
+
+import org.apache.iotdb.udf.api.UDTF;
+import org.apache.iotdb.udf.api.access.Row;
+import org.apache.iotdb.udf.api.access.RowWindow;
+import org.apache.iotdb.udf.api.collector.PointCollector;
+import org.apache.iotdb.udf.api.customizer.config.UDTFConfigurations;
+import org.apache.iotdb.udf.api.customizer.parameter.UDFParameterValidator;
+import org.apache.iotdb.udf.api.customizer.parameter.UDFParameters;
+
+public class PythonUDTF implements UDTF {
+  @Override
+  public void validate(UDFParameterValidator validator) throws Exception {
+    UDTF.super.validate(validator);
+  }
+
+  @Override
+  public void beforeDestroy() {
+    UDTF.super.beforeDestroy();
+  }
+
+  @Override
+  public void beforeStart(UDFParameters parameters, UDTFConfigurations configurations)
+      throws Exception {}
+
+  @Override
+  public void transform(Row row, PointCollector collector) throws Exception {
+    UDTF.super.transform(row, collector);
+  }
+
+  @Override
+  public void transform(RowWindow rowWindow, PointCollector collector) throws Exception {
+    UDTF.super.transform(rowWindow, collector);
+  }
+
+  @Override
+  public Object transform(Row row) throws Exception {
+    return UDTF.super.transform(row);
+  }
+
+  @Override
+  public void terminate(PointCollector collector) throws Exception {
+    UDTF.super.terminate(collector);
+  }
+}
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/udf/python/PythonUDTFExecutor.java b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/udf/python/PythonUDTFExecutor.java
new file mode 100644
index 0000000000..a1fe9dabd0
--- /dev/null
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/udf/python/PythonUDTFExecutor.java
@@ -0,0 +1,61 @@
+package org.apache.iotdb.db.mpp.transformation.dag.udf.python;
+
+import org.apache.iotdb.db.mpp.transformation.api.LayerPointReader;
+import org.apache.iotdb.db.mpp.transformation.dag.udf.base.UDTFExecutor;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.udf.api.access.Row;
+import org.apache.iotdb.udf.api.access.RowWindow;
+
+import java.time.ZoneId;
+import java.util.List;
+import java.util.Map;
+
+public class PythonUDTFExecutor extends UDTFExecutor {
+
+  public PythonUDTFExecutor(String functionName, ZoneId zoneId) {
+    super(functionName, zoneId);
+  }
+
+  @Override
+  public void beforeStart(
+      long queryId,
+      float collectorMemoryBudgetInMB,
+      List<String> childExpressions,
+      List<TSDataType> childExpressionDataTypes,
+      Map<String, String> attributes) {}
+
+  @Override
+  public void execute(Row row, boolean isCurrentRowNull) {}
+
+  @Override
+  public void execute(RowWindow rowWindow) {}
+
+  @Override
+  public void terminate() {}
+
+  @Override
+  public void beforeDestroy() {}
+
+  @Override
+  public LayerPointReader getPointCollector() {
+    throw new UnsupportedOperationException();
+  }
+
+  /**
+   * The strategy {@code MappableRowByRowAccessStrategy} is not supported by the Python UDF
+   * framework.
+   */
+  @Override
+  public void execute(Row row) {
+    throw new UnsupportedOperationException();
+  }
+
+  /**
+   * The strategy {@code MappableRowByRowAccessStrategy} is not supported by the Python UDF
+   * framework.
+   */
+  @Override
+  public Object getCurrentValue() {
+    throw new UnsupportedOperationException();
+  }
+}
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/udf/python/PythonUDTFPointCollector.java b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/udf/python/PythonUDTFPointCollector.java
new file mode 100644
index 0000000000..0bc32cab65
--- /dev/null
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/udf/python/PythonUDTFPointCollector.java
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.db.mpp.transformation.dag.udf.python;
+
+public class PythonUDTFPointCollector {}