diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/higherOrderFunctions.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/higherOrderFunctions.scala index adeda0981fe8..f8142d6b993c 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/higherOrderFunctions.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/higherOrderFunctions.scala @@ -291,11 +291,11 @@ case class ArrayTransform( */ // scalastyle:off line.size.limit @ExpressionDescription( - usage = """_FUNC_(expr, func) - Sorts the input array in ascending order. The elements of the - input array must be orderable. Null elements will be placed at the end of the returned - array. Since 3.0.0 this function also sorts and returns the array based on the given - comparator function. The comparator will take two arguments - representing two elements of the array. + usage = """_FUNC_(expr, func) - Sorts the input array. If func is omitted, sort + in ascending order. The elements of the input array must be orderable. Null elements + will be placed at the end of the returned array. Since 3.0.0 this function also sorts + and returns the array based on the given comparator function. The comparator will + take two arguments representing two elements of the array. It returns -1, 0, or 1 as the first element is less than, equal to, or greater than the second element. If the comparator function returns other values (including null), the function will fail and raise an error.