mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-08-18 03:58:29 +00:00
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:
@@ -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;
|
||||
|
||||
@@ -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>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user