HyukjinKwon commented on a change in pull request #28980:
URL: https://github.com/apache/spark/pull/28980#discussion_r448911819
##########
File path:
sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveExternalCatalogSuite.scala
##########
@@ -181,41 +181,25 @@ class HiveExternalCatalogSuite extends
ExternalCatalogSuite {
"INSERT overwrite directory \"fs://localhost/tmp\" select 1 as a"))
}
- test("SPARK-31061: alterTable should be able to change table provider") {
+ test("SPARK-31061: alterTable should be able to change table provider/hive")
{
val catalog = newBasicCatalog()
- val parquetTable = CatalogTable(
- identifier = TableIdentifier("parq_tbl", Some("db1")),
- tableType = CatalogTableType.MANAGED,
- storage = storageFormat.copy(locationUri = Some(new
URI("file:/some/path"))),
- schema = new StructType().add("col1", "int").add("col2", "string"),
- provider = Some("parquet"))
- catalog.createTable(parquetTable, ignoreIfExists = false)
-
- val rawTable = externalCatalog.getTable("db1", "parq_tbl")
- assert(rawTable.provider === Some("parquet"))
-
- val fooTable = parquetTable.copy(provider = Some("foo"))
- catalog.alterTable(fooTable)
- val alteredTable = externalCatalog.getTable("db1", "parq_tbl")
- assert(alteredTable.provider === Some("foo"))
- }
-
- test("SPARK-31061: alterTable should be able to change table provider from
hive") {
- val catalog = newBasicCatalog()
- val hiveTable = CatalogTable(
- identifier = TableIdentifier("parq_tbl", Some("db1")),
- tableType = CatalogTableType.MANAGED,
- storage = storageFormat,
- schema = new StructType().add("col1", "int").add("col2", "string"),
- provider = Some("hive"))
- catalog.createTable(hiveTable, ignoreIfExists = false)
-
- val rawTable = externalCatalog.getTable("db1", "parq_tbl")
- assert(rawTable.provider === Some("hive"))
-
- val fooTable = rawTable.copy(provider = Some("foo"))
- catalog.alterTable(fooTable)
- val alteredTable = externalCatalog.getTable("db1", "parq_tbl")
- assert(alteredTable.provider === Some("foo"))
+ Seq("parquet", "hive").foreach(i => {
Review comment:
nit: `foreach(i => {` -> `foreach { provider =>`
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]