grundprinzip commented on code in PR #39091:
URL: https://github.com/apache/spark/pull/39091#discussion_r1055515097


##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectStreamHandler.scala:
##########
@@ -179,6 +184,29 @@ class SparkConnectStreamHandler(responseObserver: 
StreamObserver[ExecutePlanResp
       .build()
   }
 
+  private def sendObservedMetricsToResponse(
+      clientId: String,
+      observedMetrics: Map[String, Row]): ExecutePlanResponse = {
+    val metricsObjects = observedMetrics.map { case (name, row) =>
+      val cols = (0 until row.length).map(row(_).toString)
+      ExecutePlanResponse.ObservedMetrics.ObservedMetricsObject
+        .newBuilder()
+        .setName(name)
+        .addAllValues(cols.asJava)
+        .build()
+    }
+    // Send a last batch with the observed metrics

Review Comment:
   ```suggestion
       // Prepare a response with the observed metrics.
   ```



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