pub fn match_key_indices(
    key_desc: &RelationDesc,
    value_desc: &RelationDesc,
) -> anyhow::Result<Vec<usize>> {
    let mut indices = Vec::new();
    for (name, key_type) in key_desc.iter() {
        let (index, value_type) = value_desc
            .get_by_name(name)
            .ok_or_else(|| anyhow!("Value schema missing primary key column: {}", name))?;

        if key_type == value_type {
            indices.push(index);
        } else {
            bail!(
                "key and value column types do not match: key {:?} vs. value {:?}",
                key_type,
                value_type
            );
        }
    }
    Ok(indices)
}
/// Computes the indices of the value's relation description that appear in the key.
///
/// Returns an error if it detects a common columns between the two relations that has the same
/// name but a different type, if a key column is missing from the value, and if the key relation
/// has a column with no name.
Computes the indices of the value's relation description that appear in the key.
Returns an error if it detects a common columns between the two relations that has the same
name but a different type, if a key column is missing from the value, and if the key relation
has a column with no name.
Computes the indices of the value ' s relation description that appear in the key . Returns an error if it detects a common columns between the two relations that has the same name but a different type if a key column is missing from the value and if the key relation has a column with no name .
pub fn match_key_indices(
    key_desc: &RelationDesc,
    value_desc: &RelationDesc,
) -> anyhow::Result<Vec<usize>> {
    let mut indices = Vec::new();
    for (name, key_type) in key_desc.iter() {
        let (index, value_type) = value_desc
            .get_by_name(name)
            .ok_or_else(|| anyhow!("Value schema missing primary key column: {}", name))?;
        if key_type == value_type {
            indices.push(index);
        } else {
            bail!(
                "key and value column types do not match: key {:?} vs. value {:?}",
                key_type,
                value_type
            );
        }
    }
    Ok(indices)
}
pub fn match_key_indices ( key_desc : & RelationDesc , value_desc : & RelationDesc , ) -> anyhow :: Result < Vec < usize > > { let mut indices = Vec :: new ( ) ; for ( name , key_type ) in key_desc . iter ( ) { let ( index , value_type ) = value_desc . get_by_name ( name ) . ok_or_else ( | | anyhow ! ( " " name ) ) ? ; if key_type == value_type { indices . push ( index ) ; } else { bail ! ( " " key_type value_type ) ; } } Ok ( indices ) }
Computes the indices of the value's relation description that appear in the key.
Computes the indices of the value ' s relation description that appear in the key .
key_desc
&RelationDesc
value_desc
&RelationDesc
key_desc
&RelationDesc
value_desc
&RelationDesc