Skip to content

Commit

Permalink
Fix NPE when streaming query is started but not yet executed.
Browse files Browse the repository at this point in the history
Co-authored-by: Szabolcs Vasas <[email protected]>
  • Loading branch information
2 people authored and HeartSaVioR committed Dec 15, 2020
1 parent ad478ac commit 6ea9024
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class KafkaOffsetCommitterListener extends StreamingQueryListener with Logging {
val query = SparkSession.active.streams.get(event.progress.id)
if (query != null) {
val exec = query match {
case query: StreamingQueryWrapper => Some(query.streamingQuery.lastExecution)
case query: StreamExecution => Some(query.lastExecution)
case query: StreamingQueryWrapper => Option(query.streamingQuery.lastExecution)
case query: StreamExecution => Option(query.lastExecution)
case _ =>
logWarning(s"Unexpected type of streaming query: ${query.getClass}")
None
Expand Down

0 comments on commit 6ea9024

Please sign in to comment.