-
- Downloads
[SPARK-18776][SS] Make Offset for FileStreamSource corrected formatted in json
## What changes were proposed in this pull request? - Changed FileStreamSource to use new FileStreamSourceOffset rather than LongOffset. The field is named as `logOffset` to make it more clear that this is a offset in the file stream log. - Fixed bug in FileStreamSourceLog, the field endId in the FileStreamSourceLog.get(startId, endId) was not being used at all. No test caught it earlier. Only my updated tests caught it. Other minor changes - Dont use batchId in the FileStreamSource, as calling it batch id is extremely miss leading. With multiple sources, it may happen that a new batch has no new data from a file source. So offset of FileStreamSource != batchId after that batch. ## How was this patch tested? Updated unit test. Author: Tathagata Das <tathagata.das1565@gmail.com> Closes #16205 from tdas/SPARK-18776.
Showing
- external/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/KafkaSourceOffsetSuite.scala 1 addition, 1 deletion...rg/apache/spark/sql/kafka010/KafkaSourceOffsetSuite.scala
- sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/FileStreamSource.scala 15 additions, 17 deletions...ache/spark/sql/execution/streaming/FileStreamSource.scala
- sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/FileStreamSourceLog.scala 1 addition, 1 deletion...e/spark/sql/execution/streaming/FileStreamSourceLog.scala
- sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/FileStreamSourceOffset.scala 53 additions, 0 deletions...park/sql/execution/streaming/FileStreamSourceOffset.scala
- sql/core/src/test/resources/structured-streaming/file-source-offset-version-2.1.0-json.txt 1 addition, 0 deletions...tured-streaming/file-source-offset-version-2.1.0-json.txt
- sql/core/src/test/resources/structured-streaming/file-source-offset-version-2.1.0-long.txt 0 additions, 0 deletions...tured-streaming/file-source-offset-version-2.1.0-long.txt
- sql/core/src/test/resources/structured-streaming/offset-log-version-2.1.0/0 2 additions, 2 deletions...resources/structured-streaming/offset-log-version-2.1.0/0
- sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/FileStreamSourceSuite.scala 1 addition, 1 deletion...spark/sql/execution/streaming/FileStreamSourceSuite.scala
- sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/OffsetSeqLogSuite.scala 1 addition, 1 deletion...che/spark/sql/execution/streaming/OffsetSeqLogSuite.scala
- sql/core/src/test/scala/org/apache/spark/sql/streaming/FileStreamSourceSuite.scala 20 additions, 10 deletions...rg/apache/spark/sql/streaming/FileStreamSourceSuite.scala
File moved
Please register or sign in to comment