viirya commented on a change in pull request #26422:
URL: https://github.com/apache/spark/pull/26422#discussion_r429517900



##########
File path: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala
##########
@@ -638,6 +644,17 @@ private[hive] class HiveClientImpl(
             s"No partition is dropped. One partition spec '$s' does not exist 
in table '$table' " +
             s"database '$db'")
         }
+        // Check whether the partition we are going to drop is empty.
+        // We make a dummy one for the empty partition. See [SPARK-29786] for 
more details.
+        parts.foreach { partition =>
+          val partPath = partition.getPath.head
+          if (isExistPath(partPath)) {
+            val fs = partPath.getFileSystem(conf)
+            fs.mkdirs(partPath)
+            fs.deleteOnExit(partPath)
+          }

Review comment:
       I'm confused. When the partition exists (`isExistPath` returns true), 
why you need to mkdir it again?




----------------------------------------------------------------
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:
us...@infra.apache.org



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

Reply via email to