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 @@ -27,7 +27,8 @@ import org.apache.spark.sql.types._
* Given an array or map, returns its size.
*/
@ExpressionDescription(
usage = "_FUNC_(expr) - Returns the size of an array or a map.")
usage = "_FUNC_(expr) - Returns the size of an array or a map.",
extended = " > SELECT _FUNC_(array('b', 'd', 'c', 'a'));\n 4")
case class Size(child: Expression) extends UnaryExpression with ExpectsInputTypes {
override def dataType: DataType = IntegerType
override def inputTypes: Seq[AbstractDataType] = Seq(TypeCollection(ArrayType, MapType))
Expand All @@ -48,8 +49,8 @@ case class Size(child: Expression) extends UnaryExpression with ExpectsInputType
*/
// scalastyle:off line.size.limit
@ExpressionDescription(
usage = "_FUNC_(array(obj1, obj2,...)) - Sorts the input array in ascending order according to the natural ordering of the array elements.",
extended = " > SELECT _FUNC_(array('b', 'd', 'c', 'a'));\n 'a', 'b', 'c', 'd'")
usage = "_FUNC_(array(obj1, obj2, ...), ascendingOrder) - Sorts the input array in ascending order according to the natural ordering of the array elements.",
extended = " > SELECT _FUNC_(array('b', 'd', 'c', 'a'), true);\n 'a', 'b', 'c', 'd'")
// scalastyle:on line.size.limit
case class SortArray(base: Expression, ascendingOrder: Expression)
extends BinaryExpression with ExpectsInputTypes with CodegenFallback {
Expand Down Expand Up @@ -133,7 +134,7 @@ case class SortArray(base: Expression, ascendingOrder: Expression)
* Checks if the array (left) has the element (right)
*/
@ExpressionDescription(
usage = "_FUNC_(array, value) - Returns TRUE if the array contains value.",
usage = "_FUNC_(array, value) - Returns TRUE if the array contains the value.",
extended = " > SELECT _FUNC_(array(1, 2, 3), 2);\n true")
case class ArrayContains(left: Expression, right: Expression)
extends BinaryExpression with ImplicitCastInputTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import org.apache.spark.sql.types.StringType
trait Command

/**
* Returned for the "DESCRIBE [EXTENDED] FUNCTION functionName" command.
* Returned for the "DESCRIBE FUNCTION [EXTENDED] functionName" command.
* @param functionName The function to be described.
* @param isExtended True if "DESCRIBE EXTENDED" is used. Otherwise, false.
* @param isExtended True if "DESCRIBE FUNCTION EXTENDED" is used. Otherwise, false.
*/
private[sql] case class DescribeFunction(
functionName: String,
Expand Down