itholic commented on code in PR #45923:
URL: https://github.com/apache/spark/pull/45923#discussion_r1555389485


##########
sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/HiveThriftServer2Listener.scala:
##########
@@ -218,7 +232,9 @@ private[thriftserver] class HiveThriftServer2Listener(
         executionData.state = ExecutionState.CLOSED
         updateStoreWithTriggerEnabled(executionData)
         executionList.remove(e.id)
-      case None => logWarning(s"onOperationClosed called with unknown 
operation id: ${e.id}")
+      case None => logWarning(
+        log"onOperationClosed called with unknown operation id: 
${MDC(OPERATION_ID, e.id)}"

Review Comment:
   Maybe can we keep the current behavior as it is?
   
   I'm a bit afraid that it will even become more complicated because most of 
them are slightly different except for the “called with unknown” part.
   
   For example, we might need at least 3 parameters for the common method would 
look like:
   
   ```scala
   private def logWarningWithUnknownId(eventType: String, id: String, 
additionalMessage: String = ""): Unit = {
     val idType = eventType match {
       case "operation" => OPERATION_ID
       case "session" => SESSION_ID
     }
     logWarning(log"$eventType called with unknown $idType: ${MDC(idType, 
id)}." + additionalMessage)
   }
   ```



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