Github user HeartSaVioR commented on a diff in the pull request:
https://github.com/apache/spark/pull/22282#discussion_r214639674
--- Diff:
external/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/KafkaRelationSuite.scala
---
@@ -136,6 +142,19 @@ class KafkaRelationSuite extends QueryTest with
SharedSQLContext with KafkaTest
checkAnswer(df, (0 to 30).map(_.toString).toDF)
}
+ test("default starting and ending offsets with headers") {
+ val topic = newTopic()
+ testUtils.createTopic(topic, partitions = 3)
+ testUtils.sendMessage(topic, (null, "1", Array(("once", "1"),
("twice", "2"))), Some(0))
+ testUtils.sendMessage(topic, (null, "2", Array(("once", "2"),
("twice", "4"))), Some(1))
+ testUtils.sendMessage(topic, (null, "3", Array(("once", "3"),
("twice", "6"))), Some(2))
+
+ // Implicit offset values, should default to earliest and latest
+ val df = createDF(topic, Map.empty[String, String], None, true)
--- End diff --
nit: explicitly assigning `includeHeaders = true` may look easier to see.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]