wzhfy commented on a change in pull request #27079: [SPARK-30410][SQL]
Calculating size of table with large number of partitions causes flooding logs
URL: https://github.com/apache/spark/pull/27079#discussion_r363068298
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/command/CommandUtils.scala
##########
@@ -124,8 +128,8 @@ object CommandUtils extends Logging {
0L
}
}.getOrElse(0L)
- val durationInMs = (System.nanoTime() - startTime) / (1000 * 1000)
- logInfo(s"It took $durationInMs ms to calculate the total file size under
path $locationUri.")
+ val durationInMs = (System.nanoTime() - startTime) / 1e6
+ logDebug(s"It took $durationInMs ms to calculate the total file size under
path $locationUri.")
Review comment:
@srowen yes, it could be called in the "else" branch above, and one
partition per log would be too much if the number of partitions is very large.
```
partitions.map { p =>
calculateLocationSize(sessionState, catalogTable.identifier,
p.storage.locationUri)
}.sum
```
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]