zecookiez commented on code in PR #49816:
URL: https://github.com/apache/spark/pull/49816#discussion_r1962434697
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/StateStore.scala:
##########
@@ -281,10 +285,20 @@ object StateStoreMetrics {
customMetric -> sumOfMetrics
}.toMap
+ val distinctInstanceMetrics =
allMetrics.flatMap(_.instanceMetrics.keys).distinct
+ val instanceMetrics = allMetrics.flatMap(_.instanceMetrics)
+ val combinedInstanceMetrics = distinctInstanceMetrics.map { instanceMetric
=>
+ val sameMetrics = instanceMetrics.filter(_._1 == instanceMetric)
+ // Use the instance metric's custom ordering to select the combined
metric value
+ val selectedMetrics = sameMetrics.map(_._2).min(instanceMetric.ordering)
+ instanceMetric -> selectedMetrics
Review Comment:
I've changed this to just overwrite duplicate keys, which shouldn't happen
anyways. Thanks!
--
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]