cloud-fan commented on a change in pull request #26899: [SPARK-28332][SQL] 
Reserve init value -1 only when do min max statistics in SQLMetrics
URL: https://github.com/apache/spark/pull/26899#discussion_r358173494
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/metric/SQLMetrics.scala
 ##########
 @@ -67,7 +67,9 @@ class SQLMetric(val metricType: String, initValue: Long = 
0L) extends Accumulato
 
   def +=(v: Long): Unit = _value += v
 
-  override def value: Long = _value
+  def getRawValue(): Long = _value
+
+  override def value: Long = Math.max(_value, 0)
 
 Review comment:
   can you explain how are you going to change the initial value? This change 
here doesn't change the initial value directly.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

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

Reply via email to