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

    https://github.com/apache/spark/pull/9297#discussion_r45099809
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/metric/SQLMetrics.scala 
---
    @@ -126,31 +144,25 @@ private[sql] object SQLMetrics {
        * spill size, etc.
        */
       def createSizeMetric(sc: SparkContext, name: String): LongSQLMetric = {
    -    val stringValue = (values: Seq[Long]) => {
    -      // This is a workaround for SPARK-11013.
    -      // We use -1 as initial value of the accumulator, if the accumulator 
is valid, we will update
    -      // it at the end of task and the value will be at least 0.
    -      val validValues = values.filter(_ >= 0)
    -      val Seq(sum, min, med, max) = {
    -        val metric = if (validValues.length == 0) {
    -          Seq.fill(4)(0L)
    -        } else {
    -          val sorted = validValues.sorted
    -          Seq(sorted.sum, sorted(0), sorted(validValues.length / 2), 
sorted(validValues.length - 1))
    -        }
    -        metric.map(Utils.bytesToString)
    -      }
    -      s"\n$sum ($min, $med, $max)"
    -    }
         // The final result of this metric in physical operator UI may looks 
like:
         // data size total (min, med, max):
         // 100GB (100MB, 1GB, 10GB)
    -    createLongMetric(sc, s"$name total (min, med, max)", stringValue, -1L)
    +    createLongMetric(sc, s"$name total (min, med, max)", 
StaticsLongSQLMetricParam)
    +  }
    +
    +  def getMetricParam(metricParamName: String): 
SQLMetricParam[SQLMetricValue[Any], Any] = {
    +    val longSQLMetricParam = 
Utils.getFormattedClassName(LongSQLMetricParam)
    +    val staticsSQLMetricParam = 
Utils.getFormattedClassName(StaticsLongSQLMetricParam)
    +    val metricParam = metricParamName match {
    +        case `longSQLMetricParam` => LongSQLMetricParam
    --- End diff --
    
    nit: indented too far


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to