cloud-fan commented on a change in pull request #33590:
URL: https://github.com/apache/spark/pull/33590#discussion_r681071652
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala
##########
@@ -780,6 +780,8 @@ object NullPropagation extends Rule[LogicalPlan] {
Literal.create(null, e.dataType)
} else if (newChildren.length == 1) {
newChildren.head
+ } else if (!newChildren.head.nullable) {
Review comment:
can we generalize it? I think we should find the first non-nullable
child, and drop all other children after it.
```
else {
Coalesce(newChildren.take(newChildren.indexWhere(_.nullable) + 1))
}
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]