Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/11189#discussion_r52824392
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/InMemoryCatalog.scala
---
@@ -244,29 +247,41 @@ class InMemoryCatalog extends Catalog {
partSpecs.foreach(existingParts.remove)
}
- override def alterPartition(
+ override def renamePartitions(
db: String,
table: String,
- spec: Map[String, String],
- newPart: TablePartition): Unit = synchronized {
- assertPartitionExists(db, table, spec)
- val existingParts = catalog(db).tables(table).partitions
- if (spec != newPart.spec) {
- // Also a change in specs; remove the old one and add the new one
back
- existingParts.remove(spec)
+ specs: Seq[TablePartitionSpec],
+ newSpecs: Seq[TablePartitionSpec]): Unit = synchronized {
+ assert(specs.size == newSpecs.size, "number of old and new partition
specs differ")
--- End diff --
and maybe assertDatabaseExists should be called requireDatabaseExists too
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]