pub fn prune_chunks<C, P, O>(observer: &O, summaries: Vec<C>, predicate: &Predicate) -> Vec<C>
where
    C: AsRef<P>,
    P: Prunable,
    O: PruningObserver<Observed = P>,
{
    let num_chunks = summaries.len();
    debug!(num_chunks, %predicate, "Pruning chunks");

    let filter_expr = match predicate.filter_expr() {
        Some(expr) => expr,
        None => {
            observer.could_not_prune("No expression on predicate");
            return summaries;
        }
    };

    // TODO: performance optimization: batch the chunk pruning by
    // grouping the chunks with the same types for all columns
    // together and then creating a single PruningPredicate for each
    // group.
    let pruned_summaries: Vec<_> = summaries
        .into_iter()
        .filter(|c| must_keep(observer, c.as_ref(), &filter_expr))
        .collect();

    debug!(
        num_chunks,
        num_pruned_chunks = pruned_summaries.len(),
        "Pruned chunks"
    );
    pruned_summaries
}
/// Given a Vec of prunable items, returns a possibly smaller set
/// filtering those that can not pass the predicate.
Given a Vec of prunable items, returns a possibly smaller set
filtering those that can not pass the predicate.
Given a Vec of prunable items returns a possibly smaller set filtering those that can not pass the predicate .
pub fn prune_chunks<C, P, O>(observer: &O, summaries: Vec<C>, predicate: &Predicate) -> Vec<C>
where
    C: AsRef<P>,
    P: Prunable,
    O: PruningObserver<Observed = P>,
{
    let num_chunks = summaries.len();
    debug!(num_chunks, %predicate, "Pruning chunks");
    let filter_expr = match predicate.filter_expr() {
        Some(expr) => expr,
        None => {
            observer.could_not_prune("No expression on predicate");
            return summaries;
        }
    };
    // TODO: performance optimization: batch the chunk pruning by
    // grouping the chunks with the same types for all columns
    // together and then creating a single PruningPredicate for each
    // group.
    let pruned_summaries: Vec<_> = summaries
        .into_iter()
        .filter(|c| must_keep(observer, c.as_ref(), &filter_expr))
        .collect();
    debug!(
        num_chunks,
        num_pruned_chunks = pruned_summaries.len(),
        "Pruned chunks"
    );
    pruned_summaries
}
pub fn prune_chunks < C , P , O > ( observer : & O , summaries : Vec < C > , predicate : & Predicate ) -> Vec < C > where C : AsRef < P > , P : Prunable , O : PruningObserver < Observed = P > , { let num_chunks = summaries . len ( ) ; debug ! ( num_chunks predicate " " ) ; let filter_expr = match predicate . filter_expr ( ) { Some ( expr ) => expr , None => { observer . could_not_prune ( " " ) ; return summaries ; } } ; // TODO: performance optimization: batch the chunk pruning by // grouping the chunks with the same types for all columns // together and then creating a single PruningPredicate for each // group. let pruned_summaries : Vec < _ > = summaries . into_iter ( ) . filter ( | c | must_keep ( observer , c . as_ref ( ) , & filter_expr ) ) . collect ( ) ; debug ! ( num_chunks num_pruned_chunks pruned_summaries len ( ) " " ) ; pruned_summaries }
Given a Vec of prunable items, returns a possibly smaller set
filtering those that can not pass the predicate.
Given a Vec of prunable items returns a possibly smaller set filtering those that can not pass the predicate .
observer
&O
summaries
Vec<C>
predicate
&Predicate
observer
&O
summaries
Vec<C>
predicate
&Predicate