HyukjinKwon commented on code in PR #36230:
URL: https://github.com/apache/spark/pull/36230#discussion_r851817750


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/joins.scala:
##########
@@ -144,6 +144,8 @@ object EliminateOuterJoin extends Rule[LogicalPlan] with 
PredicateHelper {
     val emptyRow = new GenericInternalRow(attributes.length)
     val boundE = BindReferences.bindReference(e, attributes)
     if (boundE.exists(_.isInstanceOf[Unevaluable])) return false
+    // don't evaluate an expression that might purposefully throw an exception
+    if (boundE.exists(_.isInstanceOf[RaiseError])) return false

Review Comment:
   In fact, we should filter out all expressions that do not inherit `NoThrow` 
(and mark all other no-throw expressions). But that's incomplete now. Given 
that it already optimized all other expressions before, I am fine with this 
band-aid fix.



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

Reply via email to