Github user mn-mikke commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21024#discussion_r180892505
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala
 ---
    @@ -287,3 +287,70 @@ case class ArrayContains(left: Expression, right: 
Expression)
     
       override def prettyName: String = "array_contains"
     }
    +
    +
    +/**
    + * Returns the maximum value in the array.
    + */
    +@ExpressionDescription(
    +  usage = "_FUNC_(array) - Returns the maximum value in the array.",
    +  examples = """
    +    Examples:
    +      > SELECT _FUNC_(array(1, 20, null, 3));
    +       20
    +  """, since = "2.4.0")
    +case class ArrayMax(child: Expression) extends UnaryExpression with 
ImplicitCastInputTypes {
    +
    +  override def nullable: Boolean =
    +    child.nullable || child.dataType.asInstanceOf[ArrayType].containsNull
    +
    +  override def foldable: Boolean = child.foldable
    --- End diff --
    
    The same line of code is in `UnaryExpression`.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to