Results of 1 - 1 of about 1 for DuckDBFunctions (0.001 sec.)
- Write User Defined Functions 9414
- Overview The JDBC driver can register user-defined functions (UDFs) written in Java, including scalar functions and table functions. This page covers building and registering both, from the simple functional-interface overloads to the vecto
...rized interface, along with type mapping and the function registry. Scalar Functions Build a scalar function with the DuckDBFunctions.scalarFunction() builder — which returns an org.duckdb.DuckDBScalarFunctionBuilder — and register it on a connection with...NTEGER , BIGINT , or DOUBLE and avoid boxing. import java.sql.Connection; import java.sql.DriverManager; import org.duckdb.DuckDBFunctions; try (Connection conn = DriverManager.getConnection("jdbc:duckdb:")) { DuckDBFunctions.scalarFunction() .withName("java_ad...nn); } SELECT java_add_one(41); The binary overloads take two arguments of the same type, declared with withParameters() : DuckDBFunctions.scalarFunction() .withName("java_weighted_sum") .withParameters(double.class, double.class) .withReturnType(double.class)... - https://man.mtool.work/duckdb/2.0/clients/java/functions.html
PREV
1
NEXT
DuckDB 2.0 Documentation / man.mtool.work