Github user chenghao-intel commented on a diff in the pull request:

    https://github.com/apache/spark/pull/9297#discussion_r45290988
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/ui/SQLListener.scala ---
    @@ -193,38 +214,39 @@ private[sql] class SQLListener(conf: SparkConf) 
extends SparkListener with Loggi
         }
       }
     
    -  def onExecutionStart(
    -      executionId: Long,
    -      description: String,
    -      details: String,
    -      physicalPlanDescription: String,
    -      physicalPlanGraph: SparkPlanGraph,
    -      time: Long): Unit = {
    -    val sqlPlanMetrics = physicalPlanGraph.nodes.flatMap { node =>
    -      node.metrics.map(metric => metric.accumulatorId -> metric)
    -    }
    -
    -    val executionUIData = new SQLExecutionUIData(executionId, description, 
details,
    -      physicalPlanDescription, physicalPlanGraph, sqlPlanMetrics.toMap, 
time)
    -    synchronized {
    -      activeExecutions(executionId) = executionUIData
    -      _executionIdToData(executionId) = executionUIData
    -    }
    -  }
    -
    -  def onExecutionEnd(executionId: Long, time: Long): Unit = synchronized {
    -    _executionIdToData.get(executionId).foreach { executionUIData =>
    -      executionUIData.completionTime = Some(time)
    -      if (!executionUIData.hasRunningJobs) {
    -        // onExecutionEnd happens after all "onJobEnd"s
    -        // So we should update the execution lists.
    -        markExecutionFinished(executionId)
    -      } else {
    -        // There are some running jobs, onExecutionEnd happens before some 
"onJobEnd"s.
    -        // Then we don't if the execution is successful, so let the last 
onJobEnd updates the
    -        // execution lists.
    +  override def onOtherEvent(event: SparkListenerEvent): Unit = event match 
{
    +    case executionStart: SparkListenerSQLExecutionStart =>
    +      val physicalPlanGraph = SparkPlanGraph(executionStart.sparkPlanInfo)
    +      val sqlPlanMetrics = physicalPlanGraph.nodes.flatMap { node =>
    +        node.metrics.map(metric => metric.accumulatorId -> metric)
    +      }
    +      val executionUIData = new SQLExecutionUIData(
    +        executionStart.executionId,
    +        executionStart.description,
    +        executionStart.details,
    +        executionStart.physicalPlanDescription,
    +        physicalPlanGraph,
    +        sqlPlanMetrics.toMap,
    +        executionStart.time)
    +      synchronized {
    +        activeExecutions(executionStart.executionId) = executionUIData
    +        _executionIdToData(executionStart.executionId) = executionUIData
    +      }
    +    case executionEnd: SparkListenerSQLExecutionEnd => synchronized {
    --- End diff --
    
    Same here


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to