feat: time series distribution in scanner (#5675)

* define distribution

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* feat: SeqScan support per series distribution

* probe distribution

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* reverse sort order

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* more strict check

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* fix clippy

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* change null's ordering

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

---------

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
Co-authored-by: evenyag <realevenyag@gmail.com>
This commit is contained in:
Ruihang Xia
2025-03-09 22:43:17 -07:00
committed by GitHub
parent 0acc6b0354
commit 73ca39f37e
16 changed files with 426 additions and 43 deletions
+1 -1
View File
@@ -25,5 +25,5 @@ pub use datatypes::schema::{
};
pub use self::descriptors::*;
pub use self::requests::{ScanRequest, TimeSeriesRowSelector};
pub use self::requests::{ScanRequest, TimeSeriesDistribution, TimeSeriesRowSelector};
pub use self::types::SequenceNumber;
+13
View File
@@ -25,6 +25,17 @@ pub enum TimeSeriesRowSelector {
LastRow,
}
/// A hint on how to distribute time-series data on the scan output.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Display)]
pub enum TimeSeriesDistribution {
/// Data are distributed by time window first. The scanner will
/// return all data within one time window before moving to the next one.
TimeWindowed,
/// Data are organized by time-series first. The scanner will return
/// all data for one time-series before moving to the next one.
PerSeries,
}
#[derive(Default, Clone, Debug, PartialEq, Eq)]
pub struct ScanRequest {
/// Indices of columns to read, `None` to read all columns. This indices is
@@ -45,4 +56,6 @@ pub struct ScanRequest {
/// If set, only rows with a sequence number lesser or equal to this value
/// will be returned.
pub sequence: Option<SequenceNumber>,
/// Optional hint for the distribution of time-series data.
pub distribution: Option<TimeSeriesDistribution>,
}