bersprockets commented on code in PR #36230:
URL: https://github.com/apache/spark/pull/36230#discussion_r854698752
##########
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
val v = boundE.eval(emptyRow)
Review Comment:
>RaiseError doesn't match all the expressions that may fail during
evaluation.
I see what you mean. This query also fails in `EliminateOuterJoin` (because
you can't have a null key):
```
select *
from (select id, id as b from range(0, 10)) l
left outer join (select id, id + 1 as c from range(0, 10)) r
on l.id = r.id
where map(c, '2') is not null;
```
I will add a try/catch.
--
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]