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


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/QueryExecution.scala:
##########
@@ -540,20 +540,26 @@ object QueryExecution {
   }
 
   /**
-   * Converts asserts, null pointer exceptions to internal errors.
+   * Converts asserts, null pointer exceptions and scala match errors to 
internal errors.
    */
   private[sql] def toInternalError(msg: String, e: Throwable): Throwable = e 
match {
     case e @ (_: java.lang.NullPointerException | _: java.lang.AssertionError) 
=>
       SparkException.internalError(
         msg + " You hit a bug in Spark or the Spark plugins you use. Please, 
report this bug " +
           "to the corresponding communities or vendors, and provide the full 
stack trace.",
         e)
+    case e @ (_: scala.MatchError) =>

Review Comment:
   let's avoid duplicated code, we can add a new function `def 
isInternalError`, then rewrite here
   ```
   if (isInternalError(e)) {
     internal error ...
   } else {
     e
   }
   ```



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