From 254dce9e05ba129dd2830007f639c2068e8e5ad8 Mon Sep 17 00:00:00 2001 From: xxchan Date: Mon, 30 Sep 2024 15:59:24 +0800 Subject: [PATCH] chore: add comment for KafkaSplit's start_offset (#18766) Signed-off-by: xxchan --- src/connector/src/source/kafka/split.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/connector/src/source/kafka/split.rs b/src/connector/src/source/kafka/split.rs index 7ad0d52619b4..791836ac2c85 100644 --- a/src/connector/src/source/kafka/split.rs +++ b/src/connector/src/source/kafka/split.rs @@ -22,6 +22,14 @@ use crate::source::{SplitId, SplitMetaData}; pub struct KafkaSplit { pub(crate) topic: String, pub(crate) partition: i32, + /// Note: currently the start offset is **exclusive**. We need to `+1` to create the reader. + /// Possible values are: + /// - `Earliest`: `low_watermark` - 1 + /// - `Latest`: `high_watermark` - 1 + /// - `Timestamp`: `offset_for_timestamp` - 1 + /// - `last_seen_offset` + /// + /// A better approach would be to make it **inclusive**. pub(crate) start_offset: Option, pub(crate) stop_offset: Option, #[serde(skip)]