Skip to main content

implied_time_range_from_exprs

Function implied_time_range_from_exprs 

Source
pub(crate) fn implied_time_range_from_exprs(
    ts_col_name: &str,
    ts_col_unit: TimeUnit,
    exprs: &[&Expr],
) -> Option<TimestampRange>
Expand description

Returns the timestamp range where all time-only predicates are guaranteed true.

Returns Some(min_to_max) for empty input (vacuously true everywhere). Returns None if any expression contains an unsupported shape: OR, NOT, IN, non-literal RHS, unsupported operator, column-name mismatch, an = literal that cannot be represented exactly in the column unit, or overflow during bound adjustment.

This is intentionally stricter than extract_time_range_from_expr in table::predicate: lower bounds round up and upper bounds round down. If a partition’s file-time range is contained by the returned range, every row in that partition satisfies the original time predicates.

IsNull/IsNotNull on the time index are not routed into time_filters today. If that changes, handle them here before stripping time filters from the cache key.