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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]