LuciferYang commented on code in PR #38940: URL: https://github.com/apache/spark/pull/38940#discussion_r1041778431
########## sql/core/src/test/scala/org/apache/spark/sql/UDFSuite.scala: ########## @@ -638,10 +638,16 @@ class UDFSuite extends QueryTest with SharedSparkSession { } test("SPARK-28521 error message for CAST(parameter types contains DataType)") { - val e = intercept[AnalysisException] { - spark.sql("SELECT CAST(1)") - } - assert(e.getMessage.contains("Invalid arguments for function cast")) + checkError( + exception = intercept[AnalysisException] { + sql("SELECT CAST(1)") Review Comment: https://github.com/apache/spark/blob/37453ad5c85122d11b436813b4f5eddf615a6cf8/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala#L137-L144 In this scenario, the `validParametersCount` is also empty, so `WRONG_NUM_ARGS ` cannot be reused now -- 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