johanl-db opened a new pull request, #41555:
URL: https://github.com/apache/spark/pull/41555

   ### What changes were proposed in this pull request?
   This change brings a small improvement to allow creating SQLMetrics with an 
arbitrary initial value instead of always using `-1`.
   
   ### Why are the changes needed?
   This simplifies creating metrics when there's a need for a metric with a 
starting value other than `-1`. For example, the Delta MERGE INTO 
implementation [creates today different timing metrics and set them manually to 
0 after 
creation:](https://github.com/delta-io/delta/blob/0bec32820e95e80b6accd2c88e4d532b1247497d/spark/src/main/scala/org/apache/spark/sql/delta/commands/MergeIntoCommand.scala#L173):
   
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   ### How was this patch tested?
   Adding tests to `SQLMetricsSuite` creating metrics with initial values.


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