AngersZhuuuu commented on a change in pull request #33279:
URL: https://github.com/apache/spark/pull/33279#discussion_r669376346



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileFormatWriter.scala
##########
@@ -301,8 +301,14 @@ object FileFormatWriter extends Logging {
     try {
       Utils.tryWithSafeFinallyAndFailureCallbacks(block = {
         // Execute the task to write rows out and commit the task.
-        dataWriter.writeWithIterator(iterator)
-        dataWriter.commit()
+        val taskAttemptID = taskAttemptContext.getTaskAttemptID
+        val (res, timeCost) = Utils.timeTakenMs {
+          logDebug("$taskAttemptID starts to write and commit.")
+          dataWriter.writeWithIterator(iterator)
+          dataWriter.commit()
+        }
+        logInfo(s"$taskAttemptID finished to write and commit. Elapsed time: 
$timeCost ms.")

Review comment:
       > After some more thought, I think it's better to use SQL metrics for 
it. It's very hard to know max/min/avg by reading the logs.
   > 
   > @AngersZhuuuu I think you tried it before. Can you restore the work?
   
   Yea, working on this




-- 
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.

To unsubscribe, e-mail: [email protected]

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