gengliangwang commented on code in PR #59520:
URL: https://github.com/apache/spark/pull/59520#discussion_r4591604511


##########
docs/sql-native-data-sources.md:
##########
@@ -129,9 +129,13 @@ Spark calls the functions of the table as follows:
   the checkpoint of the source in a `SparkDsStreamReaderInfo`. When the 
checkpoint does not have the
   initial offset of the source yet, Spark asks for it with `initial_offset`, 
and keeps it in the
   checkpoint, so a query that restarts before its first micro-batch is 
committed starts from the
-  same offset. For each micro-batch, it asks for the `latest_offset`, with the 
offset that the
-  micro-batch starts after, plans the partitions with `stream_partitions`, 
which also returns the
-  state of the stream reader, and calls `read` on the executors. With 
`Trigger.AvailableNow`, a run
+  same offset. For each micro-batch, it asks for the `latest_offset`, with the 
starting progress
+  boundary of the micro-batch, plans the partitions with `stream_partitions`, 
which also returns the
+  state of the stream reader, and calls `read` on the executors. 
`stream_partitions` gets the
+  starting and ending progress boundaries of the micro-batch, and the library 
defines how offsets
+  map to records: if an offset is the next row to read, `{"next":10}` to 
`{"next":13}` reads rows
+  10, 11, and 12. Equal boundaries describe no data, and adjacent ranges must 
neither repeat nor

Review Comment:
   Filed SPARK-61820 for this contract change: the progress-boundary wording of 
the header, the guide and the JVM doc comments, and the rule that adjacent 
ranges must neither repeat nor skip records, naming the C++ SDK (#59726) as one 
of the implementations it applies to. It still lands with this PR, and the PR 
description now describes it in a paragraph under SPARK-61820.



##########
sql/core/src/main/resources/org/apache/spark/sql/datasource/spark_datasource.h:
##########
@@ -517,7 +517,12 @@ typedef struct SparkDsLatestOffsetInfo {
 typedef struct SparkDsStreamPartitionsInfo {
   /* The size of this struct in the header that Spark was built with, as in 
SparkDsHost. */
   int64_t size;
-  /* The offsets, as JSON, that the micro-batch reads the data after, up to 
and including end. */
+  /*
+   * The starting and ending progress boundaries, as JSON. The library defines 
how offsets map
+   * to records: if an offset is the next row to read, {"next":10} to 
{"next":13} reads rows
+   * 10, 11, and 12, the range [10, 13). Equal boundaries describe no data, 
and adjacent ranges

Review Comment:
   Filed SPARK-61820, see 
https://github.com/apache/spark/pull/59520#discussion_r4591022621.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to