Github user tdas commented on a diff in the pull request:
https://github.com/apache/spark/pull/16918#discussion_r101160295
--- Diff: docs/structured-streaming-kafka-integration.md ---
@@ -187,50 +306,68 @@ The following options must be set for the Kafka
source.
The following configurations are optional:
<table class="table">
-<tr><th>Option</th><th>value</th><th>default</th><th>meaning</th></tr>
+<tr><th>Option</th><th>value</th><th>default</th><th>query
type</th><th>meaning</th></tr>
<tr>
<td>startingOffsets</td>
- <td>earliest, latest, or json string
- {"topicA":{"0":23,"1":-1},"topicB":{"0":-2}}
+ <td>"earliest", "latest" (streaming only), or json string
+ """ {"topicA":{"0":23,"1":-1},"topicB":{"0":-2}} """
</td>
- <td>latest</td>
+ <td>"latest" for streaming, "earliest" for batch</td>
+ <td>streaming and batch</td>
<td>The start point when a query is started, either "earliest" which is
from the earliest offsets,
"latest" which is just from the latest offsets, or a json string
specifying a starting offset for
each TopicPartition. In the json, -2 as an offset can be used to refer
to earliest, -1 to latest.
- Note: This only applies when a new Streaming query is started, and that
resuming will always pick
- up from where the query left off. Newly discovered partitions during a
query will start at
+ Note: For Batch queries, latest (either implicitly or by using -1 in
json) is not allowed.
+ For Streaming queries, this only applies when a new query is started,
and that resuming will
+ always pick up from where the query left off. Newly discovered
partitions during a query will start at
earliest.</td>
</tr>
<tr>
+ <td>endingOffsets</td>
+ <td>latest or json string
+ {"topicA":{"0":23,"1":-1},"topicB":{"0":-1}}
+ </td>
+ <td>latest</td>
+ <td>batch only</td>
+ <td>The end point when a batch query is ended, either "latest" which is
just referred to the
+ latest, or a json string specifying an ending offset for each
TopicPartition. In the json, -1
+ as an offset can be used to refer to latest, and -2 (earliest) as an
offset is not allowed.</td>
+</tr>
+<tr>
<td>failOnDataLoss</td>
<td>true or false</td>
<td>true</td>
- <td>Whether to fail the query when it's possible that data is lost
(e.g., topics are deleted, or
+ <td>streaming only</td>
+ <td>Whether to fail the query when it's possible that data is lost
(e.g., topics are deleted, or
--- End diff --
nit: the *streaming* query
also could you add, what is the behavior for batch queries? that is the
batch query will always fail if it fails to read any data.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]