Skip to main content

map_compare_series

Function map_compare_series 

Source
pub fn map_compare_series(
    schema: &Arc<SeriesSchema>,
    vector: &Series,
    comparison: Comparison,
    scalar: ScalarSeriesOperand<'_>,
) -> Result<(Option<Series>, bool)>
Expand description

Compares against a time-varying scalar. Filter keeps vector values and labels; bool emits 0/1 and drops the metric name.

Shares map_arithmetic_series’s alignment and row-keeping contract. Each field is compared independently; a row is kept where any field passes a filter.

A histogram has no ordering against a scalar, so the positions it holds answer nothing; the second element of the answer reports whether one was dropped so the caller can say so. The literal-scalar form (crate::map::map_compare_literal) applies the same rule, and both exist because a time-varying scalar cannot be folded into a constant.