diff --git a/segment_store/src/segment.rs b/segment_store/src/segment.rs index b1621a028a..8f3c09bf1a 100644 --- a/segment_store/src/segment.rs +++ b/segment_store/src/segment.rs @@ -168,20 +168,20 @@ impl Segment { /// predicates. /// /// Right now, predicates are conjunctive (AND). - pub fn read_filter<'a>( - &'a self, - columns: &[ColumnName<'a>], + pub fn read_filter<'input>( + &self, + columns: &'input [ColumnName<'input>], predicates: &[Predicate<'_>], - ) -> ReadFilterResult<'_> { + ) -> ReadFilterResult<'input, '_> { let row_ids = self.row_ids_from_predicates(predicates); ReadFilterResult(self.materialise_rows(columns, row_ids)) } - fn materialise_rows<'a>( - &'a self, - columns: &[ColumnName<'a>], + fn materialise_rows<'input>( + &self, + columns: &'input [ColumnName<'input>], row_ids: RowIDsOption, - ) -> Vec<(ColumnName<'_>, Values<'_>)> { + ) -> Vec<(ColumnName<'input>, Values<'_>)> { let mut results = vec![]; match row_ids { RowIDsOption::None(_) => results, // nothing to materialise @@ -615,15 +615,15 @@ impl MetaData { /// Encapsulates results from segments with a structure that makes them easier /// to work with and display. -pub struct ReadFilterResult<'a>(pub Vec<(ColumnName<'a>, Values<'a>)>); +pub struct ReadFilterResult<'input, 'segment>(pub Vec<(ColumnName<'input>, Values<'segment>)>); -impl<'a> ReadFilterResult<'a> { +impl<'input, 'segment> ReadFilterResult<'input, 'segment> { pub fn is_empty(&self) -> bool { self.0.is_empty() } } -impl<'a> std::fmt::Debug for &ReadFilterResult<'a> { +impl<'input, 'segment> std::fmt::Debug for &ReadFilterResult<'input, 'segment> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { // header line. for (i, (k, _)) in self.0.iter().enumerate() { @@ -640,7 +640,7 @@ impl<'a> std::fmt::Debug for &ReadFilterResult<'a> { } } -impl<'a> std::fmt::Display for &ReadFilterResult<'a> { +impl<'input, 'segment> std::fmt::Display for &ReadFilterResult<'input, 'segment> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { if self.is_empty() { return Ok(()); diff --git a/segment_store/src/table.rs b/segment_store/src/table.rs index 5fedcfe8fb..40c6fcce87 100644 --- a/segment_store/src/table.rs +++ b/segment_store/src/table.rs @@ -132,11 +132,11 @@ impl Table { /// but can be ranged by time, which should be represented as nanoseconds /// since the epoch. Results are included if they satisfy the predicate and /// fall with the [min, max) time range domain. - pub fn select<'a>( - &'a self, - columns: &[ColumnName<'a>], + pub fn select<'input>( + &self, + columns: &'input [ColumnName<'input>], predicates: &[Predicate<'_>], - ) -> ReadFilterResults<'a> { + ) -> ReadFilterResults<'input, '_> { // identify segments where time range and predicates match could match // using segment meta data, and then execute against those segments and // merge results. @@ -510,18 +510,18 @@ impl MetaData { /// Encapsulates results from tables with a structure that makes them easier /// to work with and display. -pub struct ReadFilterResults<'a> { - pub names: Vec>, - pub values: Vec>, +pub struct ReadFilterResults<'input, 'segment> { + pub names: Vec>, + pub values: Vec>, } -impl<'a> ReadFilterResults<'a> { +impl<'input, 'segment> ReadFilterResults<'input, 'segment> { pub fn is_empty(&self) -> bool { self.values.is_empty() } } -impl<'a> Display for ReadFilterResults<'a> { +impl<'input, 'segment> Display for ReadFilterResults<'input, 'segment> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { // header line. for (i, k) in self.names.iter().enumerate() {