Github user yhuai commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12871#discussion_r62295951
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/InMemoryCatalog.scala
 ---
    @@ -272,9 +362,29 @@ class InMemoryCatalog extends ExternalCatalog {
           specs: Seq[TablePartitionSpec],
           newSpecs: Seq[TablePartitionSpec]): Unit = synchronized {
         require(specs.size == newSpecs.size, "number of old and new partition 
specs differ")
    +
    +    val tableDir = new Path(catalog(db).db.locationUri, table)
    +    val partitionColumnNames = getTable(db, table).partitionColumnNames
    +    // TODO: we should follow hive to roll back if one partition path 
failed to rename.
         specs.zip(newSpecs).foreach { case (oldSpec, newSpec) =>
           val newPart = getPartition(db, table, oldSpec).copy(spec = newSpec)
           val existingParts = catalog(db).tables(table).partitions
    +
    +      if (newPart.storage.locationUri.isEmpty) {
    --- End diff --
    
    Let's add a comment at here to explain the meaning of this condition. (if 
location is not set, the partition is using the default partition location, 
right?)


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to