Skip to content

Instantly share code, notes, and snippets.

//TODO Code it

Nilesh Injulkar injulkarnilesh

//TODO Code it
View GitHub Profile
lovasoa / VectorMean.scala
Created Feb 15, 2018
spark UDAF for computing the mean of vectors
View VectorMean.scala
import{Vector, Vectors}
import org.apache.spark.sql.Row
import org.apache.spark.sql.expressions.{MutableAggregationBuffer, UserDefinedAggregateFunction}
import org.apache.spark.sql.types._
class VectorMean extends UserDefinedAggregateFunction {
// This is the input fields for your aggregate function.