You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/10/27 15:02:01 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #30147: [SPARK-33240][SQL] Fail fast when fails to instantiate configured v2 session catalog

cloud-fan commented on a change in pull request #30147:
URL: https://github.com/apache/spark/pull/30147#discussion_r512768618



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/connector/SupportsCatalogOptionsSuite.scala
##########
@@ -254,6 +255,24 @@ class SupportsCatalogOptionsSuite extends QueryTest with SharedSparkSession with
     }
   }
 
+  test("SPARK-33240: fail the query when instantiation on session catalog fails") {
+    val oldCatalogImpl = spark.conf.getOption(V2_SESSION_CATALOG_IMPLEMENTATION.key)
+    try {
+      spark.sessionState.catalogManager.reset()
+      spark.conf.set(
+        V2_SESSION_CATALOG_IMPLEMENTATION.key, "InvalidCatalogClass")
+      val e = intercept[SparkException] {
+        sql(s"create table t1 (id bigint) using $format")
+      }
+
+      assert(e.getMessage.contains("Cannot find catalog plugin class"))
+      assert(e.getMessage.contains("InvalidCatalogClass"))
+    } finally {
+      spark.sessionState.catalogManager.reset()
+      oldCatalogImpl.foreach { cat => spark.conf.set(V2_SESSION_CATALOG_IMPLEMENTATION.key, cat) }

Review comment:
       This is already set/unset in `before` and `afterEach`




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org