Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add an unit test
  • Loading branch information
yaooqinn committed Oct 17, 2019
commit a990a3138d8a3079d6d01e9fec30f26cd15dbe76
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,19 @@ class VersionsSuite extends SparkFunSuite with Logging {
assert(client.getTable("default", "src").properties.contains("changed"))
}

test(s"$version: alterTable - should respect the original catalog table's owner name") {
val ownerName = "SPARK-29405"
val originalTable = client.getTable("default", "src")
// mocking the owner is what we declared
val newTable = originalTable.copy(owner = ownerName)
client.alterTable(newTable)
assert(client.getTable("default", "src") === ownerName)
// mocking the owner is empty
val newTable2 = originalTable.copy(owner = "")
client.alterTable(newTable2)
assert(client.getTable("default", "src") === client.userName)
}

test(s"$version: alterTable(dbName: String, tableName: String, table: CatalogTable)") {
val newTable = client.getTable("default", "src").copy(properties = Map("changedAgain" -> ""))
client.alterTable("default", "src", newTable)
Expand Down