Skip to content

Instantly share code, notes, and snippets.

@josep2
Created December 19, 2016 16:39
Show Gist options
  • Save josep2/6d8bcc3e3e545247bc2e7bc445fbe866 to your computer and use it in GitHub Desktop.
Save josep2/6d8bcc3e3e545247bc2e7bc445fbe866 to your computer and use it in GitHub Desktop.
// Taken From: https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/expressions/udaf.scala#L128-L136
@scala.annotation.varargs
def apply(exprs: Column*): Column = {
val aggregateExpression =
AggregateExpression(
ScalaUDAF(exprs.map(_.expr), this),
Complete,
isDistinct = false)
Column(aggregateExpression)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment