I am new to scala , I need to understand what is going on with below code snippet more specifically the sampleFunc val:
val sampleFunc: Seq[Row] => (Int, Long, Boolean, Row, String) = (mem: Seq[Row]) => {
//some code
(a1,b1,c1,d1,e1) // returning the value
}
spark.udf.register("sampleUDF", udf(sampleFunc,
StructType(
Seq(
StructField(a, IntegerType),
StructField(b, LongType),
StructField(c, BooleanType),
StructField(d, StructType(schema.fields)),
StructField(e, StringType)
)
)))
Thanks.