fn check_short_circuit<'a>(
lhs: &'a ColumnarValue,
op: &Operator,
) -> ShortCircuitStrategy<'a>Expand description
Checks if a logical operator (AND/OR) can short-circuit evaluation based on the left-hand side (lhs) result.
Short-circuiting occurs under these circumstances:
- For
AND:- if LHS is all false => short-circuit → return LHS
- if LHS is all true => short-circuit → return RHS
- if LHS is mixed and true_count/sum_count <=
PRE_SELECTION_THRESHOLD-> pre-selection
- For
OR:- if LHS is all true => short-circuit → return LHS
- if LHS is all false => short-circuit → return RHS
§Arguments
lhs- The left-hand side (lhs) columnar value (array or scalar)lhs- The left-hand side (lhs) columnar value (array or scalar)op- The logical operator (ANDorOR)
§Implementation Notes
- Only works with Boolean-typed arguments (other types automatically return
false) - Handles both scalar values and array values
- For arrays, uses optimized bit counting techniques for boolean arrays