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


##########
sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2FunctionSuite.scala:
##########
@@ -322,14 +321,7 @@ class DataSourceV2FunctionSuite extends 
DatasourceV2SQLBase {
   test("scalar function: bad magic method") {
     
catalog("testcat").asInstanceOf[SupportsNamespaces].createNamespace(Array("ns"),
 emptyProps)
     addFunction(Identifier.of(Array("ns"), "strlen"), StrLen(StrLenBadMagic))
-    // TODO assign a error-classes name
-    checkError(
-      exception = intercept[SparkException] {
-        sql("SELECT testcat.ns.strlen('abc')").collect()
-      },
-      errorClass = null,
-      parameters = Map.empty
-    )
+    intercept[UnsupportedOperationException](sql("SELECT 
testcat.ns.strlen('abc')").collect())

Review Comment:
   shall we still use `checkError`?



##########
sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2FunctionSuite.scala:
##########
@@ -341,7 +333,7 @@ class DataSourceV2FunctionSuite extends DatasourceV2SQLBase 
{
   test("scalar function: no implementation found") {
     
catalog("testcat").asInstanceOf[SupportsNamespaces].createNamespace(Array("ns"),
 emptyProps)
     addFunction(Identifier.of(Array("ns"), "strlen"), StrLen(StrLenNoImpl))
-    intercept[SparkException](sql("SELECT testcat.ns.strlen('abc')").collect())
+    intercept[UnsupportedOperationException](sql("SELECT 
testcat.ns.strlen('abc')").collect())

Review Comment:
   ditto



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