cloud-fan commented on code in PR #36586: URL: https://github.com/apache/spark/pull/36586#discussion_r881181890
########## sql/core/src/test/scala/org/apache/spark/sql/internal/CatalogSuite.scala: ########## @@ -553,4 +570,100 @@ class CatalogSuite extends SharedSparkSession with AnalysisTest { }.getMessage assert(errMsg.contains("my_temp_table is a temp view. 'recoverPartitions()' expects a table")) } + + test("three layer namespace compatibility - create managed table") { + spark.conf.set("spark.sql.catalog.testcat", classOf[InMemoryCatalog].getName) + val catalogName = "testcat" + val dbName = "my_db" + val tableName = "my_table" + val tableSchema = new StructType().add("i", "int") + val description = "this is a test table" + + val df = spark.catalog.createTable( + tableName = Array(catalogName, dbName, tableName).mkString("."), + source = classOf[FakeV2Provider].getName, + schema = tableSchema, + description = description, + options = Map.empty[String, String]) + assert(df.schema.equals(tableSchema)) + + val testCatalog = + spark.sessionState.catalogManager.catalog("testcat").asTableCatalog Review Comment: ```suggestion spark.sessionState.catalogManager.catalog(catalogName).asTableCatalog ``` -- 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