You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/07/14 07:51:59 UTC
[GitHub] [spark] AngersZhuuuu commented on a change in pull request #33279: [SPARK-36070][CORE] Log time cost info for writing rows out and committing the task
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org