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


##########
sql/core/src/test/scala/org/apache/spark/sql/execution/SQLFunctionSuite.scala:
##########
@@ -87,4 +87,23 @@ class SQLFunctionSuite extends QueryTest with 
SharedSparkSession {
       checkAnswer(sql("SELECT bar(1)"), Row(2))
     }
   }
+
+  test("SQL UDF in higher-order function should fail with clear error 
message") {
+    withUserDefinedFunction("test_lower_udf" -> false) {
+      sql(
+        """
+          |CREATE FUNCTION test_lower_udf(s STRING)
+          |RETURNS STRING
+          |RETURN lower(s)
+          |""".stripMargin)
+      val exception = intercept[AnalysisException] {

Review Comment:
   let's use `checkError` to test errors.



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