You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/04/18 07:33:36 UTC

[GitHub] [spark] cloud-fan commented on a diff in pull request #36230: [SPARK-38868][SQL] Avoid `RaiseError` exceptions while optimizing outer joins

cloud-fan commented on code in PR #36230:
URL: https://github.com/apache/spark/pull/36230#discussion_r851944618


##########
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:
   can we do a try-catch and swallow the error here? `RaiseError` doesn't match all the expressions that may fail during evaluation.



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