case classUserDefinedFunction(f: AnyRef, dataType: DataType, inputTypes: Seq[DataType] = immutable.this.Nil) extends Product with Serializable
A user-defined function. To create one, use the udf functions in functions.
As an example:
// Defined a UDF that returns true or false based on some numeric score.val predict = udf((score: Double) =>if (score > 0.5) trueelsefalse)
// Projects a column that adds a prediction column based on the score column.
df.select( predict(df("score")) )
A user-defined function. To create one, use the
udf
functions in functions. As an example:1.3.0