pub fn spec_is_up_to_date(
view_meta: &ViewMetadata,
spec: &SourceDataBlocksInMemory,
block_order: BlockOrder,
candidates: &[PartitionFreshnessRow],
) -> Result<bool, Error>Expand description
Filters candidates down to the rows the per-spec SQL used to return (exact range equality for
BlockOrder::EventTime, exact match for a degenerate BlockOrder::InsertTime range, inclusive
overlap otherwise), then applies the same rows.len() == 1 / file_schema_hash /
object-count checks is_jit_partition_up_to_date always has.
block_order selects which comparison applies (see BlockOrder):
BlockOrder::EventTime(thread_spans/net_spansonly) requires exact insert-range and exact count equality. Their cut points can move betweenjit_updateruns, so a later run’s spec can be narrower than an already-written partition that still overlaps it; the overlap/>=test below would call that stale, wider partition up to date and leave it in place forever. Exact equality reports “not up to date” instead, so the write falls through toRetireMatch::Overlap(seewrite_partition.rs).BlockOrder::InsertTime(every other JIT view) keeps the original overlap/>=-count test (with an exact-match branch for a degenerate spec range, to avoid matching multiple/wider rows). Their cut points are stable across runs, so a stale spec already covered by a wider committed partition – e.g. from a concurrentjit_updatethat lost a race – must stay a no-op here:RetireMatch::Containmentcannot retire a merely-overlapping partition, so calling such a spec “not up to date” would make the subsequent insert trip thelakehouse_partitions_no_overlapexclusion constraint.