cloud-fan commented on code in PR #44649:
URL: https://github.com/apache/spark/pull/44649#discussion_r1449954211


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/metric/SQLMetrics.scala:
##########
@@ -93,8 +91,8 @@ class SQLMetric(
   def +=(v: Long): Unit = add(v)
 
   // _value may be invalid, in many cases being -1. We should not expose it to 
the user
-  // and instead return defaultValidValue.
-  override def value: Long = if (!isValid) defaultValidValue else _value
+  // and instead return 0.
+  override def value: Long = if (!isValid) 0 else _value

Review Comment:
   can we do `if (isZero) 0 else _value`? or we are worried about negative 
values due to bugs?



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