heyihong commented on code in PR #53801:
URL: https://github.com/apache/spark/pull/53801#discussion_r2699511962


##########
sql/api/src/main/scala/org/apache/spark/sql/Observation.scala:
##########
@@ -130,7 +129,7 @@ class Observation(val name: String) {
    *   the observed metrics as a `Row`, or None if the metrics are not 
available.
    */
   private[sql] def getRowOrEmpty: Option[Row] = {
-    Try(SparkThreadUtils.awaitResult(future, 100.millis)).toOption
+    future.value.flatMap(_.toOption)

Review Comment:
   Yes, but the fundamental change is that the availability of observed metrics 
is now deterministic after the query execution finishes. I removed the lazy 
metrics collection based on @hvanhovell's comment. But I think we can consider 
making the metrics collection lazy later if collecting metrics in 
Observation.tryComplete turns out to be an issue.



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