public class UserDefinedFunction
extends Object
implements scala.Product, scala.Serializable
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")) )
Modifier and Type | Method and Description |
---|---|
Column |
apply(Column... exprs)
Returns an expression that invokes the UDF, using the given arguments.
|
Column |
apply(scala.collection.Seq<Column> exprs)
Returns an expression that invokes the UDF, using the given arguments.
|
UserDefinedFunction |
asNondeterministic()
Updates UserDefinedFunction to nondeterministic.
|
UserDefinedFunction |
asNonNullable()
Updates UserDefinedFunction to non-nullable.
|
abstract static boolean |
canEqual(Object that) |
DataType |
dataType() |
boolean |
deterministic()
Returns true iff the UDF is deterministic, i.e.
|
abstract static boolean |
equals(Object that) |
Object |
f() |
scala.Option<scala.collection.Seq<DataType>> |
inputTypes() |
boolean |
nullable()
Returns true when the UDF can return a nullable value.
|
abstract static int |
productArity() |
abstract static Object |
productElement(int n) |
static scala.collection.Iterator<Object> |
productIterator() |
static String |
productPrefix() |
UserDefinedFunction |
withName(String name)
Updates UserDefinedFunction with a given name.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public abstract static boolean canEqual(Object that)
public abstract static boolean equals(Object that)
public abstract static Object productElement(int n)
public abstract static int productArity()
public static scala.collection.Iterator<Object> productIterator()
public static String productPrefix()
public Column apply(Column... exprs)
exprs
- (undocumented)public Object f()
public DataType dataType()
public scala.Option<scala.collection.Seq<DataType>> inputTypes()
public boolean nullable()
public boolean deterministic()
public Column apply(scala.collection.Seq<Column> exprs)
exprs
- (undocumented)public UserDefinedFunction withName(String name)
name
- (undocumented)public UserDefinedFunction asNonNullable()
public UserDefinedFunction asNondeterministic()