amaliujia commented on code in PR #47684:
URL: https://github.com/apache/spark/pull/47684#discussion_r1711878135
##########
sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2SQLSuite.scala:
##########
@@ -3612,6 +3616,20 @@ class DataSourceV2SQLSuiteV1Filter
}
}
+ test("SPARK-49183: custom spark_catalog generates location for managed
tables") {
+ // Reset CatalogManager to clear the materialized `spark_catalog`
instance, so that we can
+ // configure a new implementation.
+ spark.sessionState.catalogManager.reset()
+ withSQLConf(V2_SESSION_CATALOG_IMPLEMENTATION.key ->
classOf[SimpleDelegatingCatalog].getName) {
+ withTable("t") {
+ sql(s"CREATE TABLE t (i INT) USING $v2Format")
+ val table = catalog(SESSION_CATALOG_NAME).asTableCatalog
+ .loadTable(Identifier.of(Array("default"), "t"))
+ assert(!table.properties().containsKey(TableCatalog.PROP_EXTERNAL))
Review Comment:
do we need to also test `SHOW CREATE TABLE` or `DESC TABLE` that this is a
managed table without a location?
--
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]