cloud-fan commented on code in PR #47723:
URL: https://github.com/apache/spark/pull/47723#discussion_r1716269138
##########
sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2SQLSuite.scala:
##########
@@ -3627,6 +3628,31 @@ class DataSourceV2SQLSuiteV1Filter
}
}
+ test("SPARK-49211: V2 Catalog can also support built-in data sources") {
+ def checkParquet(tableName: String, path: String): Unit = {
+ withTable(tableName) {
+ sql("CREATE TABLE " + tableName +
+ " (name STRING) USING PARQUET LOCATION '" + path + "'")
+ sql("INSERT INTO " + tableName + " VALUES('Bob')")
+ val result = sql("SELECT * FROM " + tableName).collectAsList()
+ assert(result.size() == 1)
+ assert(result.get(0).getString(0) == "Bob")
+ }
+ }
+ withSQLConf(
+ "spark.sql.catalog.testcat3" ->
classOf[V2CatalogSupportBuiltinDataSource].getName) {
+ withTempPath { path =>
+ checkParquet("testcat3.default.t", path.getAbsolutePath)
+ }
+ }
+ withSQLConf(
Review Comment:
following other tests, we should do
```
// Reset CatalogManager to clear the materialized `spark_catalog`
instance, so that we can
// configure a new implementation.
spark.sessionState.catalogManager.reset()
```
--
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]