Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import org.apache.spark.sql.catalyst.expressions._
import org.apache.spark.sql.catalyst.util.TypeUtils
import org.apache.spark.sql.types._

@ExpressionDescription(
usage = "_FUNC_(column) - Aggregate function: returns the average of the values in a group.")
case class Average(child: Expression) extends DeclarativeAggregate {

override def prettyName: String = "avg"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import org.apache.spark.sql.types._
* Definition of Pearson correlation can be found at
* http://en.wikipedia.org/wiki/Pearson_product-moment_correlation_coefficient
*/
@ExpressionDescription(
usage = "_FUNC_(column) - Aggregate function: returns the Pearson Correlation Coefficient for two columns..")
case class Corr(
left: Expression,
right: Expression,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import org.apache.spark.sql.catalyst.dsl.expressions._
import org.apache.spark.sql.catalyst.expressions._
import org.apache.spark.sql.types._

@ExpressionDescription(
usage = "_FUNC_(column) - Aggregate function: returns the number of items in a group.")
case class Count(children: Seq[Expression]) extends DeclarativeAggregate {

override def nullable: Boolean = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import org.apache.spark.sql.types._
* is used) its result will not be deterministic (unless the input table is sorted and has
* a single partition, and we use a single reducer to do the aggregation.).
*/
@ExpressionDescription(
usage = "_FUNC_(column) - Aggregate function: returns the first value in a group.")
case class First(child: Expression, ignoreNullsExpr: Expression) extends DeclarativeAggregate {

def this(child: Expression) = this(child, Literal.create(false, BooleanType))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ import org.apache.spark.sql.types._
* @param relativeSD the maximum estimation error allowed.
*/
// scalastyle:on
@ExpressionDescription(
usage = "_FUNC_(column) - Aggregate function: returns the approximate number of distinct items in a group.")
case class HyperLogLogPlusPlus(
child: Expression,
relativeSD: Double = 0.05,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ package org.apache.spark.sql.catalyst.expressions.aggregate

import org.apache.spark.sql.catalyst.expressions._

@ExpressionDescription(
usage = "_FUNC_(column) - Aggregate function: returns the kurtosis of the values in a group.")
case class Kurtosis(child: Expression,
mutableAggBufferOffset: Int = 0,
inputAggBufferOffset: Int = 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import org.apache.spark.sql.types._
* is used) its result will not be deterministic (unless the input table is sorted and has
* a single partition, and we use a single reducer to do the aggregation.).
*/
@ExpressionDescription(
usage = "_FUNC_(column) - Aggregate function: returns the last value in a group.")
case class Last(child: Expression, ignoreNullsExpr: Expression) extends DeclarativeAggregate {

def this(child: Expression) = this(child, Literal.create(false, BooleanType))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import org.apache.spark.sql.catalyst.expressions._
import org.apache.spark.sql.catalyst.util.TypeUtils
import org.apache.spark.sql.types._

@ExpressionDescription(
usage = "_FUNC_(column) - Aggregate function: returns the maximum value of the expression in a group.")
case class Max(child: Expression) extends DeclarativeAggregate {

override def children: Seq[Expression] = child :: Nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import org.apache.spark.sql.catalyst.expressions._
import org.apache.spark.sql.catalyst.util.TypeUtils
import org.apache.spark.sql.types._


@ExpressionDescription(
usage = "_FUNC_(column) - Aggregate function: returns the minimum value of the expression in a group.")
case class Min(child: Expression) extends DeclarativeAggregate {

override def children: Seq[Expression] = child :: Nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ package org.apache.spark.sql.catalyst.expressions.aggregate

import org.apache.spark.sql.catalyst.expressions._

@ExpressionDescription(
usage = "_FUNC_(column) - Aggregate function: returns the skewness of the values in a group.")
case class Skewness(child: Expression,
mutableAggBufferOffset: Int = 0,
inputAggBufferOffset: Int = 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ package org.apache.spark.sql.catalyst.expressions.aggregate

import org.apache.spark.sql.catalyst.expressions._

@ExpressionDescription(
usage = "_FUNC_(column) - Aggregate function: returns the sample standard deviation of " +
"the expression in a group.")
case class StddevSamp(child: Expression,
mutableAggBufferOffset: Int = 0,
inputAggBufferOffset: Int = 0)
Expand Down Expand Up @@ -50,6 +53,9 @@ case class StddevSamp(child: Expression,
}
}

@ExpressionDescription(
usage = "_FUNC_(column) - Aggregate function: returns the population standard deviation of" +
" the expression in a group.")
case class StddevPop(
child: Expression,
mutableAggBufferOffset: Int = 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import org.apache.spark.sql.catalyst.expressions._
import org.apache.spark.sql.catalyst.util.TypeUtils
import org.apache.spark.sql.types._

@ExpressionDescription(
usage = "_FUNC_(column) - Aggregate function: returns the sum of all values in the expression.")
case class Sum(child: Expression) extends DeclarativeAggregate {

override def children: Seq[Expression] = child :: Nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ package org.apache.spark.sql.catalyst.expressions.aggregate

import org.apache.spark.sql.catalyst.expressions._

@ExpressionDescription(
usage = "_FUNC_(column) -Aggregate function: returns the unbiased variance of the values in a group.")
case class VarianceSamp(child: Expression,
mutableAggBufferOffset: Int = 0,
inputAggBufferOffset: Int = 0)
Expand Down Expand Up @@ -50,6 +52,8 @@ case class VarianceSamp(child: Expression,
}
}

@ExpressionDescription(
usage = "_FUNC_(column) - Aggregate function: returns the population variance of the values in a group.")
case class VariancePop(
child: Expression,
mutableAggBufferOffset: Int = 0,
Expand Down