gaborgsomogyi 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_r266428621
##########
File path: docs/structured-streaming-kafka-integration.md
##########
@@ -325,6 +346,25 @@ The following configurations are optional:
always pick up from where the query left off. Newly discovered partitions
during a query will start at
earliest.</td>
</tr>
+<tr>
+ <td>endingOffsetsByTimestamp</td>
+ <td>json string
+ """ {"topicA":1000,"topicB":2000} """
+ </td>
+ <td>latest</td>
+ <td>batch query</td>
+ <td>The end point when a batch query is ended, a json string specifying an
ending timesamp 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/>
+ Spark simply passes the timestamp information to
`KafkaConsumer.offsetForTimes`, and doesn't interpret or reason about the
value. <p/>
+ For more details on `KafkaConsumer.offsetFormTimes`, 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: `endingOffsetsByTimestamp` takes precedence over `endingOffsets`.
+ </td>
Review comment:
Note3: For streaming queries it's not supported.
----------------------------------------------------------------
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]