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/03/19 02:30:10 UTC

[GitHub] [spark] dongjoon-hyun commented on a change in pull request #31882: [WIP][SPARK-34787] Option variable in Spark historyServer log should be displayed as actual value instead of Some(XX)

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



##########
File path: core/src/main/scala/org/apache/spark/deploy/history/ApplicationCache.scala
##########
@@ -156,18 +156,19 @@ private[history] class ApplicationCache(
    */
   @throws[NoSuchElementException]
   private def loadApplicationEntry(appId: String, attemptId: Option[String]): CacheEntry = {
-    logDebug(s"Loading application Entry $appId/$attemptId")
+    logDebug(s"Loading application Entry $appId" + attemptId.map { id => s"/$id" }.getOrElse(""))

Review comment:
       If you want to change `Some(XX)`, shall we try to use `mkString` simply?
   ```scala
   scala> Seq(Some("attempt1"), None).foreach { attemptId => println(s"appId/$attemptId") }
   appId/Some(attempt1)
   appId/None
   
   scala> Seq(Some("attempt1"), None).foreach { attemptId => println(s"appId/${attemptId.mkString}") }
   appId/attempt1
   appId/
   ```




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org