Function datafusion::physical_expr::intervals::cp_solver::propagate_comparison
source ยท pub fn propagate_comparison(
op: &Operator,
parent: &Interval,
left_child: &Interval,
right_child: &Interval,
) -> Result<Option<(Interval, Interval)>, DataFusionError>
Expand description
This function refines intervals left_child
and right_child
by applying
comparison propagation through parent
via operation. The main idea is
that we can shrink ranges of variables x and y using parent interval p.
Two intervals can be ordered in 6 ways for a Gt >
operator:
(1): Infeasible, short-circuit
left: | ================ |
right: | ======================== |
(2): Update both interval
left: | ====================== |
right: | ====================== |
|
V
left: | ======= |
right: | ======= |
(3): Update left interval
left: | ============================== |
right: | ========== |
|
V
left: | ===================== |
right: | ========== |
(4): Update right interval
left: | ========== |
right: | =========================== |
|
V
left: | ========== |
right | ================== |
(5): No change
left: | ============================ |
right: | =================== |
(6): No change
left: | ==================== |
right: | =============== |
-inf --------------------------------------------------------------- +inf