pub fn distinct_values<'a>(
        &'a self,
        row_ids: impl Iterator<Item = u32>,
        mut dst: BTreeSet<Option<&'a str>>,
    ) -> BTreeSet<Option<&'a str>> {
        // TODO(edd): Perf... We can improve on this if we know the column is
        // totally ordered.
        dst.clear();

        for row_id in row_ids {
            let encoded_id = self.encoded_data[row_id as usize];

            let value = self.entries[encoded_id as usize].as_deref();
            if !dst.contains(&value) {
                dst.insert(value);
            }

            if dst.len() as u32 == self.cardinality() {
                // no more distinct values to find.
                return dst;
            }
        }

        dst
    }
/// Returns references to the unique set of values encoded at each of the
/// provided ids.
///
/// It is the caller's responsibility to ensure row ids are a monotonically
/// increasing set.
Returns references to the unique set of values encoded at each of the
provided ids.

It is the caller's responsibility to ensure row ids are a monotonically
increasing set.
Returns references to the unique set of values encoded at each of the provided ids . It is the caller ' s responsibility to ensure row ids are a monotonically increasing set .
pub fn distinct_values<'a>(
        &'a self,
        row_ids: impl Iterator<Item = u32>,
        mut dst: BTreeSet<Option<&'a str>>,
    ) -> BTreeSet<Option<&'a str>> {
        // TODO(edd): Perf... We can improve on this if we know the column is
        // totally ordered.
        dst.clear();
        for row_id in row_ids {
            let encoded_id = self.encoded_data[row_id as usize];
            let value = self.entries[encoded_id as usize].as_deref();
            if !dst.contains(&value) {
                dst.insert(value);
            }
            if dst.len() as u32 == self.cardinality() {
                // no more distinct values to find.
                return dst;
            }
        }
        dst
    }
pub fn distinct_values < ' a > ( & ' a self , row_ids : impl Iterator < Item = u32 > , mut dst : BTreeSet < Option < & ' a str > > , ) -> BTreeSet < Option < & ' a str > > { // TODO(edd): Perf... We can improve on this if we know the column is // totally ordered. dst . clear ( ) ; for row_id in row_ids { let encoded_id = self . encoded_data [ row_id as usize ] ; let value = self . entries [ encoded_id as usize ] . as_deref ( ) ; if ! dst . contains ( & value ) { dst . insert ( value ) ; } if dst . len ( ) as u32 == self . cardinality ( ) { // no more distinct values to find. return dst ; } } dst }
Returns references to the unique set of values encoded at each of the
provided ids.
Returns references to the unique set of values encoded at each of the provided ids .
&'a self
row_ids
impl Iterator<Item = u32>
dst
BTreeSet<Option<&'a str>>
&'a self
row_ids
impl Iterator<Item = u32>
dst
BTreeSet<Option<&'a str>>