Github user zsxwing commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16109#discussion_r91176023
  
    --- Diff: 
external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/CachedKafkaConsumer.scala
 ---
    @@ -190,10 +194,31 @@ private[kafka010] case class CachedKafkaConsumer 
private(
         } else {
           val record = fetchedData.next()
           nextOffsetInFetchedData = record.offset + 1
    -      // `seek` is always called before "poll". So "record.offset" must be 
same as "offset".
    -      assert(record.offset == offset,
    -        s"The fetched data has a different offset: expected $offset but 
was ${record.offset}")
    -      record
    +      // In general, Kafka uses the specified offset as the start point, 
and tries to fetch the next
    --- End diff --
    
    Based on 
https://github.com/apache/kafka/blob/0.10.0.1/core/src/main/scala/kafka/log/Log.scala#L488


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to