kelvinjian-db commented on code in PR #47877:
URL: https://github.com/apache/spark/pull/47877#discussion_r1731808873
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala:
##########
@@ -598,7 +598,7 @@ object SimplifyConditionals extends Rule[LogicalPlan] {
// a branch with a true condition eliminates all following branches,
// these branches can be pruned away
val (h, t) = branches.span(_._1 != TrueLiteral)
- CaseWhen( h :+ t.head, None)
Review Comment:
also, can we add a comment explaining why we need to populate the else value
here?
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala:
##########
@@ -598,7 +598,7 @@ object SimplifyConditionals extends Rule[LogicalPlan] {
// a branch with a true condition eliminates all following branches,
// these branches can be pruned away
val (h, t) = branches.span(_._1 != TrueLiteral)
- CaseWhen( h :+ t.head, None)
Review Comment:
nit: fix extra space?
--
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]