use crate::bridge::physical_plan::{DocumentOp, PhysicalPlan};
pub(super) fn extract_bulk_predicate_info(plan: &PhysicalPlan) -> (String, Vec<u8>) {
match plan {
PhysicalPlan::Document(DocumentOp::BulkUpdate {
collection,
filters,
..
})
| PhysicalPlan::Document(DocumentOp::BulkDelete {
collection,
filters,
..
}) => (collection.clone(), filters.clone()),
_ => (String::new(), vec![]),
}
}
pub(super) fn inject_ollp_surrogates(plan: &mut PhysicalPlan, surrogates: Vec<u32>) {
match plan {
PhysicalPlan::Document(DocumentOp::BulkUpdate {
ollp_predicted_surrogates,
..
})
| PhysicalPlan::Document(DocumentOp::BulkDelete {
ollp_predicted_surrogates,
..
}) => {
*ollp_predicted_surrogates = Some(surrogates);
}
_ => {}
}
}