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

    https://github.com/apache/spark/pull/21469#discussion_r206738919
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/streaming/progress.scala ---
    @@ -48,12 +49,24 @@ class StateOperatorProgress private[sql](
       def prettyJson: String = pretty(render(jsonValue))
     
       private[sql] def copy(newNumRowsUpdated: Long): StateOperatorProgress =
    -    new StateOperatorProgress(numRowsTotal, newNumRowsUpdated, 
memoryUsedBytes)
    +    new StateOperatorProgress(numRowsTotal, newNumRowsUpdated, 
memoryUsedBytes, customMetrics)
     
       private[sql] def jsonValue: JValue = {
    -    ("numRowsTotal" -> JInt(numRowsTotal)) ~
    -    ("numRowsUpdated" -> JInt(numRowsUpdated)) ~
    -    ("memoryUsedBytes" -> JInt(memoryUsedBytes))
    +    def safeMapToJValue[T](map: ju.Map[String, T], valueToJValue: T => 
JValue): JValue = {
    --- End diff --
    
    T is always Long. Why make a generic function for that? This does not even 
need a separate function. 


---

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

Reply via email to