Skip to main content

collect_conjunction_bounds

Function collect_conjunction_bounds 

Source
fn collect_conjunction_bounds(
    expr: &PartitionExpr,
) -> Option<CollectedConjunction>
Expand description

Collects per-column bounds and passthrough atoms from a pure AND tree.

Scope and intent:

  • This helper is shared by is_empty_and_conjunction and simplify_and_bounds so both paths interpret conjunction atoms the same way.
  • It only handles conjunction-only expressions. If any OR is present, it returns None and lets callers keep their conservative fallback behavior.

Behavior:

  • Tightest lower/upper bounds are recorded per column.
  • = contributes both a lower and an upper bound at the same value.
  • != and non-range atoms are preserved in passthrough for callers that need to rebuild the conjunction.
  • has_conflict is set when atomic constraints already contradict each other (for example a = 1 AND a <> 1).

Notes:

  • This helper is intentionally a bit more general than the current split_partition_expr contract, which now only feeds range-only conjunctions into the main split path.