pub fn optimize_dataflow_filters_inner<'a, I>(
    view_iter: I,
    predicates: &mut HashMap<Id, HashSet<expr::MirScalarExpr>>,
) -> Result<(), TransformError>
where
    I: Iterator<Item = (Id, &'a mut MirRelationExpr)>,
{
    let transform = crate::predicate_pushdown::PredicatePushdown::default();
    for (id, view) in view_iter {
        if let Some(list) = predicates.get(&id).clone() {
            if !list.is_empty() {
                *view = view.take_dangerous().filter(list.iter().cloned());
            }
        }
        transform.action(view, predicates)?;
    }
    Ok(())
}
/// Pushes filters down through views in `view_sequence` in order.
///
/// This method is made public for the sake of testing.
/// TODO: make this private once we allow multiple exports per dataflow.
Pushes filters down through views in `view_sequence` in order.
This method is made public for the sake of testing.
TODO: make this private once we allow multiple exports per dataflow.
Pushes filters down through views in ` view_sequence ` in order . This method is made public for the sake of testing . TODO : make this private once we allow multiple exports per dataflow .
pub fn optimize_dataflow_filters_inner<'a, I>(
    view_iter: I,
    predicates: &mut HashMap<Id, HashSet<expr::MirScalarExpr>>,
) -> Result<(), TransformError>
where
    I: Iterator<Item = (Id, &'a mut MirRelationExpr)>,
{
    let transform = crate::predicate_pushdown::PredicatePushdown::default();
    for (id, view) in view_iter {
        if let Some(list) = predicates.get(&id).clone() {
            if !list.is_empty() {
                *view = view.take_dangerous().filter(list.iter().cloned());
            }
        }
        transform.action(view, predicates)?;
    }
    Ok(())
}
pub fn optimize_dataflow_filters_inner < ' a , I > ( view_iter : I , predicates : & mut HashMap < Id , HashSet < expr :: MirScalarExpr > > , ) -> Result < ( ) , TransformError > where I : Iterator < Item = ( Id , & ' a mut MirRelationExpr ) > , { let transform = crate :: predicate_pushdown :: PredicatePushdown :: default ( ) ; for ( id , view ) in view_iter { if let Some ( list ) = predicates . get ( & id ) . clone ( ) { if ! list . is_empty ( ) { * view = view . take_dangerous ( ) . filter ( list . iter ( ) . cloned ( ) ) ; } } transform . action ( view , predicates ) ? ; } Ok ( ( ) ) }
Pushes filters down through views in `view_sequence` in order.
Pushes filters down through views in ` view_sequence ` in order .
view_iter
I
predicates
&mut HashMap<Id, HashSet<expr::MirScalarExpr>>
view_iter
I
predicates
&mut HashMap<Id, HashSet<expr::MirScalarExpr>>