stczwd commented on a change in pull request #30935:
URL: https://github.com/apache/spark/pull/30935#discussion_r549351336
##########
File path:
sql/catalyst/src/test/scala/org/apache/spark/sql/connector/InMemoryPartitionTable.scala
##########
@@ -107,4 +107,17 @@ class InMemoryPartitionTable(
currentRow == ident
}.toArray
}
+
+ override def renamePartition(from: InternalRow, to: InternalRow): Boolean = {
+ if (memoryTablePartitions.containsKey(to)) {
+ throw new PartitionAlreadyExistsException(name, to, partitionSchema)
+ } else {
+ val partValue = memoryTablePartitions.remove(from)
+ if (partValue == null) {
+ throw new NoSuchPartitionException(name, from, partitionSchema)
+ }
+ memoryTablePartitions.put(to, partValue) == null &&
+ renamePartitionKey(partitionSchema, from.toSeq(schema), to.toSeq(schema))
Review comment:
nit:
```
memoryTablePartitions.put(to, partValue) == null &&
renamePartitionKey(partitionSchema, from.toSeq(schema), to.toSeq(schema))
```
----------------------------------------------------------------
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]