jose-torres commented on a change in pull request #23747: [SPARK-26848][SQL]
Introduce new option to Kafka source: offset by timestamp (starting/ending)
URL: https://github.com/apache/spark/pull/23747#discussion_r266590158
##########
File path: docs/structured-streaming-kafka-integration.md
##########
@@ -310,6 +310,26 @@ The following configurations are optional:
<table class="table">
<tr><th>Option</th><th>value</th><th>default</th><th>query
type</th><th>meaning</th></tr>
+<tr>
+ <td>startingOffsetsByTimestamp</td>
+ <td>json string
+ """ {"topicA":1000,"topicB":2000} """
+ </td>
+ <td>none (the value of `startingOffsets` will apply)</td>
+ <td>streaming and batch</td>
+ <td>The start point of timestamp when a query is started, a json string
specifying a starting timestamp for
+ each topic. The returned offset for each partition is the earliest offset
whose timestamp is greater than or
+ equal to the given timestamp in the corresponding partition. If the matched
offset doesn't exist,
+ the offset will be set to latest.<p/>
+ <p/>
+ This option leverages `KafkaConsumer.offsetForTimes`: please refer
https://kafka.apache.org/21/javadoc/org/apache/kafka/clients/consumer/KafkaConsumer.html#offsetsForTimes-java.util.Map-
for details.<p/>
+ Also the meaning of `timestamp` here can be vary according to Kafka
configuration (`log.message.timestamp.type`): please refer
https://kafka.apache.org/documentation/ for further details.<p/>
+ Note: This option requires Kafka 0.10.1.0 or higher.<p/>
+ Note2: `startingOffsetsByTimestamp` takes precedence over
`startingOffsets`.<p/>
Review comment:
Agreed.
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]