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

    https://github.com/apache/spark/pull/20097#discussion_r159960120
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/MicroBatchExecution.scala
 ---
    @@ -236,14 +264,27 @@ class MicroBatchExecution(
         val hasNewData = {
           awaitProgressLock.lock()
           try {
    -        val latestOffsets: Map[Source, Option[Offset]] = uniqueSources.map 
{
    +        // Generate a map from each unique source to the next available 
offset.
    +        val latestOffsets: Map[BaseStreamingSource, Option[Offset]] = 
uniqueSources.map {
               case s: Source =>
                 updateStatusMessage(s"Getting offsets from $s")
                 reportTimeTaken("getOffset") {
                   (s, s.getOffset)
                 }
    +          case s: MicroBatchReader =>
    +            updateStatusMessage(s"Getting offsets from $s")
    +            reportTimeTaken("getOffset") {
    +              // Once v1 streaming source execution is gone, we can 
refactor this away.
    +              // For now, we set the range here to get the source to infer 
the available end offset,
    +              // get that offset, and then set the range again when we 
later execute.
    +            s.setOffsetRange(
    --- End diff --
    
    incorrect indentation.


---

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

Reply via email to