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 2022/05/10 02:17:18 UTC

[GitHub] [spark] pan3793 commented on a diff in pull request #36485: [SPARK-39128][SQL][HIVE] Log cost time for getting FileStatus in HadoopTableReader

pan3793 commented on code in PR #36485:
URL: https://github.com/apache/spark/pull/36485#discussion_r868751869


##########
sql/hive/src/main/scala/org/apache/spark/sql/hive/TableReader.scala:
##########
@@ -175,7 +175,8 @@ class HadoopTableReader(
             def updateExistPathSetByPathPattern(pathPatternStr: String): Unit = {
               val pathPattern = new Path(pathPatternStr)
               val fs = pathPattern.getFileSystem(hadoopConf)
-              val matches = fs.globStatus(pathPattern)
+              val (matches, timeCost) = Utils.timeTakenMs(fs.globStatus(pathPattern))
+              logInfo(s"Get FileStatus for path '$pathPatternStr' costs $timeCost ms.")

Review Comment:
   Personally, I prefer to use logInfo, because 
   
   1) the message is not noisy, `pathPatternStr` matches the table path, which means if the query access 10 tables, just generate 10 messages. 
   
   2) the PR itself aims to give more information when the user's job is stuck on listing files, the most important information is `pathPatternStr`, and I suppose most users will not turn on debug level log on production, then users have less opportunity to this message.



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