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 2020/06/22 00:54:33 UTC

[GitHub] [spark] HeartSaVioR commented on a change in pull request #28887: [SPARK-32044][SS] Kakfa continuous processing print mislead initial o…

HeartSaVioR commented on a change in pull request #28887:
URL: https://github.com/apache/spark/pull/28887#discussion_r443275238



##########
File path: external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaContinuousReader.scala
##########
@@ -70,15 +71,17 @@ class KafkaContinuousReader(
 
   private var offset: Offset = _
   override def setStartOffset(start: ju.Optional[Offset]): Unit = {
-    offset = start.orElse {
-      val offsets = initialOffsets match {
-        case EarliestOffsetRangeLimit => KafkaSourceOffset(offsetReader.fetchEarliestOffsets())
-        case LatestOffsetRangeLimit => KafkaSourceOffset(offsetReader.fetchLatestOffsets(None))
-        case SpecificOffsetRangeLimit(p) => offsetReader.fetchSpecificOffsets(p, reportDataLoss)
+    offset = start.orElseGet(new Supplier[Offset] {

Review comment:
       Nice finding! It's quite confusing on Scala-friendly developers.




----------------------------------------------------------------
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



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