fn join(mut relations: Vec<Plan>) -> Plan {
    // Can't join zero relations
    assert!(relations.len() > 0);

    // For now, no optimization of join order -- just join at the first opportunity
    let first_rel = relations.remove(0);
    relations.into_iter().fold(
        first_rel,
        |acc_step, next_step| {
            assert!(!acc_step.outputs().is_disjoint(&next_step.outputs()));
            Plan::Join(Box::new(acc_step), Box::new(next_step))
        }
    )
}
/// Given a vector of joinable relations, returns plan step
/// representing the necessary joins.
Given a vector of joinable relations, returns plan step
representing the necessary joins.
Given a vector of joinable relations returns plan step representing the necessary joins .
fn join(mut relations: Vec<Plan>) -> Plan {
    // Can't join zero relations
    assert!(relations.len() > 0);
    // For now, no optimization of join order -- just join at the first opportunity
    let first_rel = relations.remove(0);
    relations.into_iter().fold(
        first_rel,
        |acc_step, next_step| {
            assert!(!acc_step.outputs().is_disjoint(&next_step.outputs()));
            Plan::Join(Box::new(acc_step), Box::new(next_step))
        }
    )
}
fn join ( mut relations : Vec < Plan > ) -> Plan { // Can't join zero relations assert ! ( relations len ( ) 0 ) ; // For now, no optimization of join order -- just join at the first opportunity let first_rel = relations . remove ( 0 ) ; relations . into_iter ( ) . fold ( first_rel , | acc_step , next_step | { assert ! ( acc_step outputs ( ) is_disjoint ( next_step outputs ( ) ) ) ; Plan :: Join ( Box :: new ( acc_step ) , Box :: new ( next_step ) ) } ) }
Given a vector of joinable relations, returns plan step
representing the necessary joins.
Given a vector of joinable relations returns plan step representing the necessary joins .
relations
Vec<Plan>
relations
Vec<Plan>