pub fn filter_to(&self, primary_key: &[&str]) -> SortKey {
        let missing_from_catalog_key: Vec<_> = primary_key
            .iter()
            .filter(|col| !self.contains(col))
            .collect();
        if !missing_from_catalog_key.is_empty() {
            panic!(
                "Primary key column(s) found that don't appear in the catalog sort key: [{:?}]",
                missing_from_catalog_key
            )
        }

        Self::from_columns(
            self.iter()
                .map(|(col, _opts)| col)
                .filter(|col| primary_key.contains(&col.as_ref()))
                .cloned(),
        )
    }
/// Filters this sort key to contain only the columns present in the primary key, in the order
/// that the columns appear in this sort key.
///
/// # Panics
///
/// Panics if any columns in the primary key are NOT present in this sort key.
Filters this sort key to contain only the columns present in the primary key, in the order
that the columns appear in this sort key.
Filters this sort key to contain only the columns present in the primary key in the order that the columns appear in this sort key .
pub fn filter_to(&self, primary_key: &[&str]) -> SortKey {
        let missing_from_catalog_key: Vec<_> = primary_key
            .iter()
            .filter(|col| !self.contains(col))
            .collect();
        if !missing_from_catalog_key.is_empty() {
            panic!(
                "Primary key column(s) found that don't appear in the catalog sort key: [{:?}]",
                missing_from_catalog_key
            )
        }
        Self::from_columns(
            self.iter()
                .map(|(col, _opts)| col)
                .filter(|col| primary_key.contains(&col.as_ref()))
                .cloned(),
        )
    }
pub fn filter_to ( & self , primary_key : & [ & str ] ) -> SortKey { let missing_from_catalog_key : Vec < _ > = primary_key . iter ( ) . filter ( | col | ! self . contains ( col ) ) . collect ( ) ; if ! missing_from_catalog_key . is_empty ( ) { panic ! ( " " missing_from_catalog_key ) } Self :: from_columns ( self . iter ( ) . map ( | ( col , _opts ) | col ) . filter ( | col | primary_key . contains ( & col . as_ref ( ) ) ) . cloned ( ) , ) }
Filters this sort key to contain only the columns present in the primary key, in the order
that the columns appear in this sort key.
Filters this sort key to contain only the columns present in the primary key in the order that the columns appear in this sort key .
&self
primary_key
&[&str]
&self
primary_key
&[&str]
panics
Panics if any columns in the primary key are NOT present in this sort key.
Panics if any columns in the primary key are NOT present in this sort key .