rdtr commented on code in PR #56179:
URL: https://github.com/apache/spark/pull/56179#discussion_r3316227873
##########
sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2FunctionSuite.scala:
##########
@@ -726,6 +726,17 @@ class DataSourceV2FunctionSuite extends
DatasourceV2SQLBase {
checkAnswer(sql("SELECT testcat.ns.simple_strlen('abc')"), Row(3) :: Nil)
checkAnswer(sql("SELECT testcat.ns.simple_strlen('hello world')"), Row(11)
:: Nil)
}
+
+ test("SPARK-55982: function should not resolve after namespace is dropped") {
+ val cat = catalog("testcat").asInstanceOf[InMemoryCatalog]
+ cat.createNamespace(Array("dropns"), new java.util.HashMap[String,
String]())
+ addFunction(Identifier.of(Array("dropns"), "strlen"), SimpleStrLen)
+ checkAnswer(sql("SELECT testcat.dropns.strlen('abc')"), Row(3) :: Nil)
+ sql("DROP NAMESPACE testcat.dropns CASCADE")
+ intercept[Exception] {
Review Comment:
`intercept[Exception]` is too broad, any unrelated exception (NPE, etc.)
would still make this pass. Could we narrow it to the actual exception type,
e.g. AnalysisException, and ideally pin the error class via `checkError` so the
test fails if the wrong error is thrown?
--
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]