Skip to content
Snippets Groups Projects
Commit 8ce60963 authored by cody koeninger's avatar cody koeninger Committed by Tathagata Das
Browse files

[SPARK-9780] [STREAMING] [KAFKA] prevent NPE if KafkaRDD instantiation …

…fails

Author: cody koeninger <cody@koeninger.org>

Closes #8133 from koeninger/SPARK-9780 and squashes the following commits:

406259d [cody koeninger] [SPARK-9780][Streaming][Kafka] prevent NPE if KafkaRDD instantiation fails
parent 660e6dcf
No related branches found
No related tags found
No related merge requests found
......@@ -197,7 +197,11 @@ class KafkaRDD[
.dropWhile(_.offset < requestOffset)
}
override def close(): Unit = consumer.close()
override def close(): Unit = {
if (consumer != null) {
consumer.close()
}
}
override def getNext(): R = {
if (iter == null || !iter.hasNext) {
......
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