You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/08/20 18:46:36 UTC

[GitHub] [spark] zsxwing commented on a change in pull request #22282: [SPARK-23539][SS] Add support for Kafka headers in Structured Streaming

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_r312267713
 
 

 ##########
 File path: external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaOffsetReader.scala
 ##########
 @@ -432,4 +441,42 @@ private[kafka010] object KafkaOffsetReader {
     StructField("timestamp", TimestampType),
     StructField("timestampType", IntegerType)
   ))
+
+  val schemaWithHeaders = {
+    new StructType(schemaWithoutHeaders.fields :+ StructField("headers", headersType))
+  }
+
+  def kafkaSchema(includeHeaders: Boolean): StructType = {
+    if (includeHeaders) schemaWithHeaders else schemaWithoutHeaders
+  }
+
+  def toInternalRowWithoutHeaders: Record => InternalRow =
 
 Review comment:
   This should be a `val`. Otherwise, it will be called once for each record in the closure returned by `toUnsafeRowWithoutHeadersProjector`.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org