From 5916b511641be436a8a12dd76e56595abbd4ff69 Mon Sep 17 00:00:00 2001 From: "Lei, HUANG" <6406592+v0y4g3r@users.noreply.github.com> Date: Wed, 21 Jan 2026 11:52:59 +0800 Subject: [PATCH] chore: add timestamp range to flight meta (#7513) * feat(flight): add timestamp range to DoPutMetadata Add optional start_timestamp and end_timestamp fields to DoPutMetadata to support time-windowed batch operations in the Flight DoPut API. Signed-off-by: Lei, HUANG * fix: docs Signed-off-by: Lei, HUANG --------- Signed-off-by: Lei, HUANG --- src/common/grpc/src/flight/do_put.rs | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/common/grpc/src/flight/do_put.rs b/src/common/grpc/src/flight/do_put.rs index 7997b7ba79..3898740afa 100644 --- a/src/common/grpc/src/flight/do_put.rs +++ b/src/common/grpc/src/flight/do_put.rs @@ -21,22 +21,40 @@ use crate::error::{Error, SerdeJsonSnafu}; /// The metadata for "DoPut" requests and responses. /// -/// Currently, there's only a "request_id", for coordinating requests and responses in the streams. +/// Currently, there's a "request_id", for coordinating requests and responses in the streams. /// Client can set a unique request id in this metadata, and the server will return the same id in /// the corresponding response. In doing so, a client can know how to do with its pending requests. #[derive(Serialize, Deserialize)] pub struct DoPutMetadata { request_id: i64, + /// Min timestamp of the batch (optional, for time-windowed batches) + #[serde(skip_serializing_if = "Option::is_none")] + min_timestamp: Option, + /// Max timestamp of the batch (optional, for time-windowed batches) + #[serde(skip_serializing_if = "Option::is_none")] + max_timestamp: Option, } impl DoPutMetadata { pub fn new(request_id: i64) -> Self { - Self { request_id } + Self { + request_id, + min_timestamp: None, + max_timestamp: None, + } } pub fn request_id(&self) -> i64 { self.request_id } + + pub fn min_timestamp(&self) -> Option { + self.min_timestamp + } + + pub fn max_timestamp(&self) -> Option { + self.max_timestamp + } } /// The response in the "DoPut" returned stream.