Skip to content
Snippets Groups Projects
Commit 03d46aaf authored by Shixiong Zhu's avatar Shixiong Zhu
Browse files

[SPARK-15869][STREAMING] Fix a potential NPE in StreamingJobProgressListener.getBatchUIData

## What changes were proposed in this pull request?

Moved `asScala` to a `map` to avoid NPE.

## How was this patch tested?

Existing unit tests.

Author: Shixiong Zhu <shixiong@databricks.com>

Closes #14443 from zsxwing/SPARK-15869.
parent ab1e761f
No related branches found
No related tags found
No related merge requests found
......@@ -259,7 +259,7 @@ private[streaming] class StreamingJobProgressListener(ssc: StreamingContext)
// We use an Iterable rather than explicitly converting to a seq so that updates
// will propagate
val outputOpIdToSparkJobIds: Iterable[OutputOpIdAndSparkJobId] =
Option(batchTimeToOutputOpIdSparkJobIdPair.get(batchTime).asScala)
Option(batchTimeToOutputOpIdSparkJobIdPair.get(batchTime)).map(_.asScala)
.getOrElse(Seq.empty)
_batchUIData.outputOpIdSparkJobIdPairs = outputOpIdToSparkJobIds
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment