cloud-fan commented on a change in pull request #29143:
URL: https://github.com/apache/spark/pull/29143#discussion_r456494782



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/First.scala
##########
@@ -120,3 +120,10 @@ case class First(child: Expression, ignoreNullsExpr: 
Expression)
 
   override def toString: String = s"$prettyName($child)${if (ignoreNulls) " 
ignore nulls"}"
 }
+
+object FirstLast {
+  def validateIgnoreNullExpr(exp: Expression): Boolean = exp match {
+    case Literal(b: Boolean, BooleanType) => b
+    case _ => throw new AnalysisException("The second argument should be a 
boolean literal.")

Review comment:
       maybe we can pass the function name so that we can give a better error 
message.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to