Skip to content

Commit

Permalink
refactor: remove sequence number from ScanRequest (#2785)
Browse files Browse the repository at this point in the history
Signed-off-by: Ruihang Xia <[email protected]>
  • Loading branch information
waynexia authored Nov 21, 2023
1 parent a7bbd61 commit 99dbb74
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 9 deletions.
2 changes: 0 additions & 2 deletions src/metric-engine/src/metadata_region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ impl MetadataRegion {
let filter_expr = col(METADATA_SCHEMA_KEY_COLUMN_NAME).eq(lit(key));

ScanRequest {
sequence: None,
projection: Some(vec![METADATA_SCHEMA_VALUE_COLUMN_INDEX]),
filters: vec![filter_expr.into()],
output_ordering: None,
Expand Down Expand Up @@ -390,7 +389,6 @@ mod test {
let key = "test_key";
let expected_filter_expr = col(METADATA_SCHEMA_KEY_COLUMN_NAME).eq(lit(key));
let expected_scan_request = ScanRequest {
sequence: None,
projection: Some(vec![METADATA_SCHEMA_VALUE_COLUMN_INDEX]),
filters: vec![expected_filter_expr.into()],
output_ordering: None,
Expand Down
1 change: 0 additions & 1 deletion src/mito2/src/engine/projection_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ async fn test_scan_projection() {

// Scans tag_1, field_1, ts
let request = ScanRequest {
sequence: None,
projection: Some(vec![1, 3, 4]),
filters: Vec::new(),
output_ordering: None,
Expand Down
7 changes: 1 addition & 6 deletions src/store-api/src/storage/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use snafu::{OptionExt, ResultExt};
use crate::error::{
BuildColumnDescriptorSnafu, Error, InvalidDefaultConstraintSnafu, InvalidRawRegionRequestSnafu,
};
use crate::storage::{ColumnDescriptor, ColumnDescriptorBuilder, RegionDescriptor, SequenceNumber};
use crate::storage::{ColumnDescriptor, ColumnDescriptorBuilder, RegionDescriptor};

/// Write request holds a collection of updates to apply to a region.
///
Expand All @@ -48,11 +48,6 @@ pub trait WriteRequest: Send {

#[derive(Default, Clone, Debug, PartialEq, Eq)]
pub struct ScanRequest {
/// Max sequence number to read, None for latest sequence.
///
/// Default is None. Only returns data whose sequence number is less than or
/// equal to the `sequence`.
pub sequence: Option<SequenceNumber>,
/// Indices of columns to read, `None` to read all columns.
pub projection: Option<Vec<usize>>,
/// Filters pushed down
Expand Down

0 comments on commit 99dbb74

Please sign in to comment.