MCPcopy Create free account
hub / github.com/apache/datafusion / update_ranges

Method update_ranges

datafusion/physical-expr/src/intervals/cp_solver.rs:510–533  ·  view source on GitHub ↗

Updates intervals for all expressions in the DAEG by successive bottom-up and top-down traversals.

(
        &mut self,
        leaf_bounds: &mut [(usize, Interval)],
        given_range: Interval,
    )

Source from the content-addressed store, hash-verified

508 /// Updates intervals for all expressions in the DAEG by successive
509 /// bottom-up and top-down traversals.
510 pub fn update_ranges(
511 &mut self,
512 leaf_bounds: &mut [(usize, Interval)],
513 given_range: Interval,
514 ) -> Result<PropagationResult> {
515 self.assign_intervals(leaf_bounds);
516 let bounds = self.evaluate_bounds()?;
517 // There are three possible cases to consider:
518 // (1) given_range ⊇ bounds => Nothing to propagate
519 // (2) ∅ ⊂ (given_range ∩ bounds) ⊂ bounds => Can propagate
520 // (3) Disjoint sets => Infeasible
521 if given_range.contains(bounds)? == Interval::TRUE {
522 // First case:
523 Ok(PropagationResult::CannotPropagate)
524 } else if bounds.contains(&given_range)? != Interval::FALSE {
525 // Second case:
526 let result = self.propagate_constraints(given_range);
527 self.update_intervals(leaf_bounds);
528 result
529 } else {
530 // Third case:
531 Ok(PropagationResult::Infeasible)
532 }
533 }
534
535 /// This function assigns given ranges to expressions in the DAEG.
536 /// The argument `assignments` associates indices of sought expressions

Callers 3

analyzeFunction · 0.80
experimentFunction · 0.80

Calls 5

assign_intervalsMethod · 0.80
update_intervalsMethod · 0.80
evaluate_boundsMethod · 0.45
containsMethod · 0.45
propagate_constraintsMethod · 0.45

Tested by

no test coverage detected