zsxwing commented on a change in pull request #22282: [SPARK-23539][SS] Add 
support for Kafka headers in Structured Streaming
URL: https://github.com/apache/spark/pull/22282#discussion_r306009983
 
 

 ##########
 File path: 
external/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/KafkaSinkSuite.scala
 ##########
 @@ -59,14 +59,17 @@ abstract class KafkaSinkSuiteBase extends QueryTest with 
SharedSQLContext with K
 
   protected def newTopic(): String = s"topic-${topicId.getAndIncrement()}"
 
-  protected def createKafkaReader(topic: String): DataFrame = {
-    spark.read
+  protected def createKafkaReader(topic: String, includeHeaders: Boolean = 
false): DataFrame = {
+    val df = spark.read
       .format("kafka")
       .option("kafka.bootstrap.servers", testUtils.brokerAddress)
       .option("startingOffsets", "earliest")
       .option("endingOffsets", "latest")
       .option("subscribe", topic)
-      .load()
+    if (includeHeaders) {
 
 Review comment:
   nit: we can call `df.option("includeHeaders", includeHeaders.toString)` to 
save several lines here.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to