dongjoon-hyun commented on a change in pull request #29387:
URL: https://github.com/apache/spark/pull/29387#discussion_r475902402



##########
File path: core/src/main/scala/org/apache/spark/util/Utils.scala
##########
@@ -269,6 +269,26 @@ private[spark] object Utils extends Logging {
     file.setExecutable(true, true)
   }
 
+  /**
+   * Move data to trash on truncate table given
+   * 'spark.sql.truncate.trash.enabled' is true
+   */
+  def moveToTrashIfEnabled(
+      fs: FileSystem,
+      partitionPath: Path,
+      isTrashEnabled: Boolean,
+      hadoopConf: Configuration): Unit = {

Review comment:
       Let's have a return value here instead of `Unit` for the future.
   1. If `isTrashEnabled=false`, this function had better return the return 
value of `fs.delete(partitionPath, true)`.
   2. If `isTrashEnabled=true`, 
      - If `isSuccess=true`, `true` is return.
      - If `isSuccess=false`, the result of `fs.delete(partitionPath, true)` is 
return 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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to