This is an automated email from the ASF dual-hosted git repository. luzhijing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris-website.git
The following commit(s) were added to refs/heads/master by this push: new 7c6162ce3a Update java-user-defined-function.md 7c6162ce3a is described below commit 7c6162ce3ab77e2f34712bc8037e804ddc7633e7 Author: Luzhijing <82810928+luzhij...@users.noreply.github.com> AuthorDate: Tue Apr 23 10:32:59 2024 +0800 Update java-user-defined-function.md --- docs/ecosystem/udf/java-user-defined-function.md | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/docs/ecosystem/udf/java-user-defined-function.md b/docs/ecosystem/udf/java-user-defined-function.md index eaf2e2f9b4..6b0105ddbf 100644 --- a/docs/ecosystem/udf/java-user-defined-function.md +++ b/docs/ecosystem/udf/java-user-defined-function.md @@ -24,13 +24,6 @@ specific language governing permissions and limitations under the License. --> -# Java UDF - -<version since="1.2.0"> - -Java UDF - -</version> Java UDF provides users with a Java interface written in UDF to facilitate the execution of user-defined functions in Java language. Compared with native UDF implementation, Java UDF has the following advantages and limitations: 1. The advantages @@ -42,7 +35,7 @@ Java UDF provides users with a Java interface written in UDF to facilitate the e * Performance: Compared with native UDF, Java UDF will bring additional JNI overhead, but through batch execution, we have minimized the JNI overhead as much as possible. * Vectorized engine: Java UDF is only supported on vectorized engine now. -### Type correspondence +## Type correspondence |Type|UDF Argument Type| |----|---------| @@ -114,10 +107,10 @@ CREATE FUNCTION java_udf_add_one(int) RETURNS int PROPERTIES ( * The "always_nullable" is optional attribute, if there is special treatment for the NULL value in the calculation, it is determined that the result will not return NULL, and it can be set to false, so that the performance may be better in the whole calculation process. * If you use the local path method, the jar package that the database driver depends on, the FE and BE nodes must be placed here + ## Create UDAF -<br/> When using Java code to write UDAF, there are some functions that must be implemented (mark required) and an inner class State, which will be explained with a specific example below. -The following SimpleDemo will implement a simple function similar to sum, the input parameter is INT, and the output parameter is INT +The following SimpleDemo will implement a simple function similar to sum, the input parameter is INT, and the output parameter is INT. ```JAVA package org.apache.doris.udf.demo; @@ -333,10 +326,8 @@ CREATE AGGREGATE FUNCTION middle_quantiles(DOUBLE,INT) RETURNS DOUBLE PROPERTIES ); ``` -<version since="2.1"> - ## Create UDTF -<br/> + UDTF functions, like UDF functions, require users to implement an `evaluate` method. However, the return value of a UDTF function must be of Array type. Additionally, in Doris, table functions behave differently depending on the _outer suffix. You can refer to the [OUTER-Combinator](../sql-manual/sql-functions/table-functions/explode-numbers-outer) @@ -361,14 +352,10 @@ CREATE TABLES FUNCTION java-utdf(string, string) RETURNS array<string> PROPERTIE ); ``` -<br/> - * The implemented jar package can be stored at local or in a remote server and downloaded via http, And each BE node must be able to obtain the jar package; Otherwise, the error status message "Couldn't open file..." will be returned -<br/> - ## Use UDF Users must have the `SELECT` permission of the corresponding database to use UDF/UDAF. --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org