LuciferYang commented on code in PR #40892:
URL: https://github.com/apache/spark/pull/40892#discussion_r1173598454


##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/planner/SparkConnectPlanner.scala:
##########
@@ -2182,7 +2182,7 @@ class SparkConnectPlanner(val session: SparkSession) {
         respBuilder.setRecentProgress(
           StreamingQueryCommandResult.RecentProgressResult
             .newBuilder()
-            .addAllRecentProgressJson(progressReports.map(_.json).asJava)
+            
.addAllRecentProgressJson(progressReports.map(StreamingQueryProgress.jsonString).asJava)

Review Comment:
   The recentProgressJosn should like
   
   ```
   {
     "id" : "33ac26f4-1c39-46ce-b798-f3d2a21211d4",
     "runId" : "849c2c9a-b9f8-446f-9180-259a60fd888c",
     "name" : "myName",
     "timestamp" : "2016-12-05T20:54:20.827Z",
     "batchId" : 2,
     "batchDuration" : 0,
     "durationMs" : {
       "total" : 0
     },
     ...
     "observedMetrics" : {
       "event1" : {
         "values" : [ 1, 3.0 ],
         "schema" : {
           "type" : "struct",
           "fields" : [ {
             "name" : "c1",
             "type" : "long",
             "nullable" : true,
             "metadata" : { }
           }, {
             "name" : "c2",
             "type" : "double",
             "nullable" : true,
             "metadata" : { }
           } ]
         }
       },
       "event2" : {
         "values" : [ 1, "hello", "world" ],
         "schema" : {
           "type" : "struct",
           "fields" : [ {
             "name" : "rc",
             "type" : "long",
             "nullable" : true,
             "metadata" : { }
           }, {
             "name" : "min_q",
             "type" : "string",
             "nullable" : true,
             "metadata" : { }
           }, {
             "name" : "max_q",
             "type" : "string",
             "nullable" : true,
             "metadata" : { }
           } ]
         }
       }
     }
   }
   ```
   
   then we can rebuild `observedMetrics` on the connect client side



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