You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Aggregate FILTER row-validity handling is currently fragmented across helper and grouped accumulator paths. We should centralize the invariant that a row passes aggregate FILTER if and only if the predicate is Some(true).
first_last.rs still uses local filter checks in grouped paths.
accumulate_indices still repeats 64-bit validity iteration logic across multiple branches.
Problem
Duplicated nullable-filter logic increases the risk of semantic drift and regressions (especially around NULL predicate handling), and makes validity bitmap code harder to maintain.
Because grouped and non-grouped paths can evolve independently, this drift can become user-visible as incorrect aggregate results under nullable predicates.
Proposal
Add one shared helper/iterator in functions-aggregate-common that encodes:
row passes FILTER iff predicate is Some(true)
Migrate grouped first_value / last_value filter paths to this shared utility.
Refactor accumulate_indices to reuse shared validity iteration and remove duplicated loops.
Summary
Aggregate FILTER row-validity handling is currently fragmented across helper and grouped accumulator paths. We should centralize the invariant that a row passes aggregate FILTER if and only if the predicate is Some(true).
Current State
filter_to_validitywas introduced and grouped-accumulator helper paths were updated (includingaccumulate_multipleandfilter_to_nullsplumbing) in fix: Incorrect behavior forFILTERon NULLs #22068first_last.rsstill uses local filter checks in grouped paths.accumulate_indicesstill repeats 64-bit validity iteration logic across multiple branches.Problem
Duplicated nullable-filter logic increases the risk of semantic drift and regressions (especially around NULL predicate handling), and makes validity bitmap code harder to maintain.
Because grouped and non-grouped paths can evolve independently, this drift can become user-visible as incorrect aggregate results under nullable predicates.
Proposal
functions-aggregate-commonthat encodes:Some(true)first_value/last_valuefilter paths to this shared utility.accumulate_indicesto reuse shared validity iteration and remove duplicated loops.Scope
In scope:
first_lastgrouped paths.accumulate_indices.Out of scope:
Acceptance Criteria
Some(true).first_value/last_valueno longer use bespoke nullable filter checks.accumulate_indicesno longer carries duplicated validity loop logic that can drift semantically.Testing
first_valueandlast_valuewith nullable FILTER predicates.Some(true).