viirya commented on code in PR #53138:
URL: https://github.com/apache/spark/pull/53138#discussion_r2544193950
##########
sql/api/src/main/scala/org/apache/spark/sql/Observation.scala:
##########
@@ -94,18 +94,6 @@ class Observation(val name: String) {
@throws[InterruptedException]
def getAsJava: java.util.Map[String, Any] = get.asJava
- /**
- * Get the observed metrics. This returns the metrics if they are available,
otherwise an empty.
- *
- * @return
- * the observed metrics as a `Map[String, Any]`
- */
- @throws[InterruptedException]
- private[sql] def getOrEmpty: Map[String, Any] = {
- val row = getRowOrEmpty.getOrElse(Row.empty)
- row.getValuesMap(row.schema.map(_.name))
Review Comment:
There is a bug. If `getRowOrEmpty.getOrElse(Row.empty)` returns `Row.empty`,
the next line `row.schema.map(_.name)` will throw NPE because `row.schema` is
null.
Since this method is not used, just remove it.
--
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]