// Given an encoded id for a logical column value and a predicate matching
// row ids are returned.
//
// TODO(edd): add an alternative SIMD equivalent to `row_ids_equal_simd`
// here.
Given an encoded id for a logical column value and a predicate matching
row ids are returned.

add an alternative SIMD equivalent to `row_ids_equal_simd`
here.
Given an encoded id for a logical column value and a predicate matching row ids are returned . add an alternative SIMD equivalent to ` row_ids_equal_simd ` here .
fn row_ids_encoded_cmp(&self, encoded_id: u32, op: &cmp::Operator, mut dst: RowIDs) -> RowIDs {
        dst.clear();
        let cmp = match op {
            cmp::Operator::GT => PartialOrd::gt,
            cmp::Operator::GTE => PartialOrd::ge,
            cmp::Operator::LT => PartialOrd::lt,
            cmp::Operator::LTE => PartialOrd::le,
            _ => unreachable!("operator not supported"),
        };
        let mut found = false;
        let mut count = 0_u32;
        for (i, next) in self.encoded_data.iter().enumerate() {
            let cmp_result = cmp(next, &encoded_id);
            if (next == &NULL_ID || !cmp_result) && found {
                let (min, max) = (i as u32 - count, i as u32);
                dst.add_range(min, max);
                found = false;
                count = 0;
                continue;
            } else if next == &NULL_ID || !cmp_result {
                continue;
            }
            if !found {
                found = true;
            }
            count += 1;
        }
        // add any remaining range.
        if found {
            let (min, max) = (
                self.encoded_data.len() as u32 - count,
                self.encoded_data.len() as u32,
            );
            dst.add_range(min, max);
        }
        dst
    }
fn row_ids_encoded_cmp ( & self , encoded_id : u32 , op : & cmp :: Operator , mut dst : RowIDs ) -> RowIDs { dst . clear ( ) ; let cmp = match op { cmp :: Operator :: GT => PartialOrd :: gt , cmp :: Operator :: GTE => PartialOrd :: ge , cmp :: Operator :: LT => PartialOrd :: lt , cmp :: Operator :: LTE => PartialOrd :: le , _ => unreachable ! ( " " ) , } ; let mut found = false ; let mut count = 0_u32 ; for ( i , next ) in self . encoded_data . iter ( ) . enumerate ( ) { let cmp_result = cmp ( next , & encoded_id ) ; if ( next == & NULL_ID || ! cmp_result ) && found { let ( min , max ) = ( i as u32 - count , i as u32 ) ; dst . add_range ( min , max ) ; found = false ; count = 0 ; continue ; } else if next == & NULL_ID || ! cmp_result { continue ; } if ! found { found = true ; } count += 1 ; } // add any remaining range. if found { let ( min , max ) = ( self . encoded_data . len ( ) as u32 - count , self . encoded_data . len ( ) as u32 , ) ; dst . add_range ( min , max ) ; } dst }
Given an encoded id for a logical column value and a predicate matching
row ids are returned.
Given an encoded id for a logical column value and a predicate matching row ids are returned .
&self
encoded_id
u32
op
&cmp::Operator
dst
RowIDs