Package com.snowflake.snowpark_java
Class UserDefinedFunction
- java.lang.Object
-
- com.snowflake.snowpark_java.UserDefinedFunction
-
public class UserDefinedFunction extends Object
Encapsulates a user defined lambda or function that is returned byUDFRegistration.registerTemporary
,UDFRegistration.registerPermanent
, orFunctions.udf
.Use
UserDefinedFunction.apply
to generateColumn
expressions from an instance.import com.snowflake.snowpark_java.functions; import com.snowflake.snowpark_java.types.DataTypes; UserDefinedFunction myUdf = Functions.udf( (Integer x, Integer y) -> x + y, new DataType[]{DataTypes.IntegerType, DataTypes.IntegerType}, DataTypes.IntegerType ); df.select(myUdf.apply(df.col("col2"), df.col("col2")));
- Since:
- 0.12.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Column
apply(Column... exprs)
Apply the UDF to one or more columns to generate a Column expression.
-