Github user viirya commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18159#discussion_r125158558
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/command/commands.scala 
---
    @@ -19,24 +19,65 @@ package org.apache.spark.sql.execution.command
     
     import java.util.UUID
     
    +import org.apache.spark.SparkContext
     import org.apache.spark.rdd.RDD
     import org.apache.spark.sql.{Row, SparkSession}
     import org.apache.spark.sql.catalyst.{CatalystTypeConverters, InternalRow}
     import org.apache.spark.sql.catalyst.errors.TreeNodeException
     import org.apache.spark.sql.catalyst.expressions.{Attribute, 
AttributeReference}
     import org.apache.spark.sql.catalyst.plans.{logical, QueryPlan}
     import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan
    -import org.apache.spark.sql.execution.SparkPlan
    +import org.apache.spark.sql.execution.{SparkPlan, SQLExecution}
    +import org.apache.spark.sql.execution.datasources.ExecutedWriteSummary
     import org.apache.spark.sql.execution.debug._
    +import org.apache.spark.sql.execution.metric.{SQLMetric, SQLMetrics}
     import org.apache.spark.sql.execution.streaming.{IncrementalExecution, 
OffsetSeqMetadata}
     import org.apache.spark.sql.streaming.OutputMode
     import org.apache.spark.sql.types._
    +import org.apache.spark.util.Utils
     
     /**
      * A logical command that is executed for its side-effects.  
`RunnableCommand`s are
      * wrapped in `ExecutedCommand` during execution.
      */
     trait RunnableCommand extends logical.Command {
    +
    +  // The map used to record the metrics of running the command. This will 
be passed to
    +  // `ExecutedCommand` during query planning.
    +  private[sql] lazy val metrics: Map[String, SQLMetric] = Map.empty
    +
    +  /**
    +   * Callback function that update metrics collected from the writing 
operation.
    +   */
    +  protected def callbackMetricsUpdater(writeSummaries: 
Seq[ExecutedWriteSummary]): Unit = {
    --- End diff --
    
    Ok. I created a trait for them.


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