public abstract class UserDefinedFunction
extends Object
udf functions in functions.
As an example:
// Define a UDF that returns true or false based on some numeric score.
val predict = udf((score: Double) => score > 0.5)
// Projects a column that adds a prediction column based on the score column.
df.select( predict(df("score")) )
| Constructor and Description |
|---|
UserDefinedFunction() |
| Modifier and Type | Method and Description |
|---|---|
Column |
apply(Column... exprs)
Returns an expression that invokes the UDF, using the given arguments.
|
abstract Column |
apply(scala.collection.Seq<Column> exprs)
Returns an expression that invokes the UDF, using the given arguments.
|
abstract UserDefinedFunction |
asNondeterministic()
Updates UserDefinedFunction to nondeterministic.
|
abstract UserDefinedFunction |
asNonNullable()
Updates UserDefinedFunction to non-nullable.
|
abstract boolean |
deterministic()
Returns true iff the UDF is deterministic, i.e.
|
abstract boolean |
nullable()
Returns true when the UDF can return a nullable value.
|
abstract UserDefinedFunction |
withName(String name)
Updates UserDefinedFunction with a given name.
|
public Column apply(Column... exprs)
exprs - (undocumented)public abstract Column apply(scala.collection.Seq<Column> exprs)
exprs - (undocumented)public abstract UserDefinedFunction asNonNullable()
public abstract UserDefinedFunction asNondeterministic()
public abstract boolean deterministic()
public abstract boolean nullable()
public abstract UserDefinedFunction withName(String name)
name - (undocumented)