You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "beliefer (via GitHub)" <gi...@apache.org> on 2023/07/25 11:15:34 UTC

[GitHub] [spark] beliefer commented on a diff in pull request #42117: [SPARK-44517][SQL] Respect ignorenulls and child's nullability in first

beliefer commented on code in PR #42117:
URL: https://github.com/apache/spark/pull/42117#discussion_r1273379892


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/First.scala:
##########
@@ -60,7 +60,13 @@ case class First(child: Expression, ignoreNulls: Boolean)
     this(child, FirstLast.validateIgnoreNullExpr(ignoreNullsExpr, "first"))
   }
 
-  override def nullable: Boolean = true
+  override def nullable: Boolean = {
+    if (ignoreNulls) {
+      false

Review Comment:
   All the input values are null is possible, e.g. `SELECT first(col) FILTER (col is null)`.



-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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