keypointt commented on a change in pull request #25536: [SPARK-28837][SQL]
CTAS/RTAS should use nullable schema
URL: https://github.com/apache/spark/pull/25536#discussion_r316375071
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/sources/v2/DataSourceV2SQLSuite.scala
##########
@@ -500,6 +499,32 @@ class DataSourceV2SQLSuite extends QueryTest with
SharedSparkSession with Before
assert(t.isInstanceOf[UnresolvedTable], "V1 table wasn't returned as an
unresolved table")
}
+ test("CreateTableAsSelect: nullable schema") {
+ val basicCatalog = catalog("testcat").asTableCatalog
+ val atomicCatalog = catalog("testcat_atomic").asTableCatalog
+ val basicIdentifier = "testcat.table_name"
+ val atomicIdentifier = "testcat_atomic.table_name"
+
+ Seq((basicCatalog, basicIdentifier), (atomicCatalog,
atomicIdentifier)).foreach {
+ case (catalog, identifier) =>
+ spark.sql(s"CREATE TABLE $identifier USING foo AS SELECT 1 i")
+
+ val table = catalog.loadTable(Identifier.of(Array(), "table_name"))
Review comment:
in your PR https://github.com/apache/spark/pull/25507/files
`DataSourceV2DataFrameSessionCatalogSuite.scala`, there is a class variable
`v2Format` being referenced by all test cases
```
protected val v2Format: String = classOf[InMemoryTableProvider].getName
```
so I thought it's a style convention...
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]