Skip to content

Commit 4c06261

Browse files
szvasasSzabolcs Vasas
andauthored
Fix NPE when streaming query is started but not yet executed.
Co-authored-by: Szabolcs Vasas <svasas@groupon.com>
1 parent 0b7a0b4 commit 4c06261

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/scala/net/heartsavior/spark/KafkaOffsetCommitterListener.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ class KafkaOffsetCommitterListener extends StreamingQueryListener with Logging {
3838
val query = SparkSession.active.streams.get(event.progress.id)
3939
if (query != null) {
4040
val exec = query match {
41-
case query: StreamingQueryWrapper => Some(query.streamingQuery.lastExecution)
42-
case query: StreamExecution => Some(query.lastExecution)
41+
case query: StreamingQueryWrapper => Option(query.streamingQuery.lastExecution)
42+
case query: StreamExecution => Option(query.lastExecution)
4343
case _ =>
4444
logWarning(s"Unexpected type of streaming query: ${query.getClass}")
4545
None

0 commit comments

Comments
 (0)