dongjoon-hyun commented on code in PR #36220: URL: https://github.com/apache/spark/pull/36220#discussion_r853570987
########## sql/core/src/test/scala/org/apache/spark/sql/errors/QueryExecutionErrorsSuite.scala: ########## @@ -418,4 +418,20 @@ class QueryExecutionErrorsSuite extends QueryTest |""".stripMargin) } } + + test("FAILED_EXECUTE_UDF: execute user defined function") { + val e1 = intercept[SparkException] { + val words = Seq(("Jacek", 5), ("Agata", 5), ("Sweet", 6)).toDF("word", "index") + val luckyCharOfWord = udf { (word: String, index: Int) => { + word.substring(index, index + 1) + }} + words.select(luckyCharOfWord($"word", $"index")).collect() + } + assert(e1.getCause.isInstanceOf[SparkException]) + + val e2 = e1.getCause.asInstanceOf[SparkException] + assert(e2.getErrorClass === "FAILED_EXECUTE_UDF") + assert(e2.getMessage.matches("Failed to execute user defined function " + + "\\(QueryExecutionErrorsSuite\\$\\$Lambda\\$\\d+/\\d+: \\(string, int\\) => string\\)")) Review Comment: This seems to break Java 17 tests, @panbingkun and @MaxGekk . Please see the following community patch. - https://github.com/apache/spark/pull/36270 -- 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-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org