amaliujia commented on code in PR #47723:
URL: https://github.com/apache/spark/pull/47723#discussion_r1716258451
##########
sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2SQLSuite.scala:
##########
@@ -3662,3 +3681,41 @@ class SimpleDelegatingCatalog extends
DelegatingCatalogExtension {
super.createTable(ident, columns, partitions, newProps)
}
}
+
+
+class V2CatalogSupportBuiltinDataSource extends InMemoryCatalog {
+ override def name: String = "testcat3"
+
+ override def createTable(
+ ident: Identifier,
+ columns: Array[ColumnV2],
+ partitions: Array[Transform],
+ properties: util.Map[String, String]): Table = {
+ val newProps = new util.HashMap[String, String]
+ newProps.putAll(properties)
+ newProps.put(TableCatalog.PROP_LOCATION, "/tmp/test_path")
+ newProps.put(TableCatalog.PROP_EXTERNAL, "true")
Review Comment:
hmmm yeah I think entire createTable override is not required.
##########
sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2SQLSuite.scala:
##########
@@ -3627,6 +3628,24 @@ class DataSourceV2SQLSuiteV1Filter
}
}
+ test("SPARK-49211: V2 Catalog can also support built-in data sources") {
+ def checkParquet(tableName: String): Unit = {
+ withTable(tableName) {
+ sql("CREATE TABLE " + tableName +
+ " (name STRING) USING PARQUET LOCATION '/tmp/test_path'")
Review Comment:
Done
--
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]