quickwit-oss/quickwit · error

input {} has window {:?}, expected {:?}

Error message

input {} has window {:?}, expected {:?}

What it means

merge_parquet_split_metadata requires all input splits to share the same `window` (time-bucketing window). This bail fires when input i's window differs from inputs[0]'s. The output split inherits a single window value; merging splits bucketed to different windows would produce inconsistent time-range/partitioning metadata.

Source

Thrown at quickwit/quickwit-parquet-engine/src/merge/metadata_aggregation.rs:97

        }
        if input.partition_id != first.partition_id {
            bail!(
                "input {} has partition_id {}, expected {}",
                i,
                input.partition_id,
                first.partition_id
            );
        }
        if input.sort_fields != first.sort_fields {
            bail!(
                "input {} has sort_fields '{}', expected '{}'",
                i,
                input.sort_fields,
                first.sort_fields
            );
        }
        if input.window != first.window {
            bail!(
                "input {} has window {:?}, expected {:?}",
                i,
                input.window,
                first.window
            );
        }
        if !mixed_prefix_ok && input.rg_partition_prefix_len != first.rg_partition_prefix_len {
            bail!(
                "input {} has rg_partition_prefix_len {}, expected {} — splits with different \
                 prefix lengths must not appear in the same regular merge (legacy-promotion \
                 operations bypass this check)",
                i,
                input.rg_partition_prefix_len,
                first.rg_partition_prefix_len
            );
        }
    }

View on GitHub (pinned to a39730c5cd)

Solutions

  1. Include the window value in the merge-scope grouping key so only same-window splits are merged.
  2. Handle legacy non-windowed splits via the dedicated legacy-promotion path (mixed_prefix_ok / promotion op) rather than a regular merge.
  3. Pin or version the index's window configuration to avoid mixed-window eras, or run a re-bucketing migration.
  4. Log the offending split's id/window alongside the error to identify where the mixed batch came from.

Example fix

// before
let key = (split.index_uid.clone(), split.partition_id);
// after
let key = (split.index_uid.clone(), split.partition_id, split.window);
Defensive patterns

Strategy: validation

Validate before calling

fn window_consistent(inputs: &[ParquetSplitMetadata]) -> bool {
    inputs.iter().all(|s| s.window == inputs[0].window)
}

Type guard

fn same_window(inputs: &[ParquetSplitMetadata]) -> Option<Option<Window>> {
    let w = inputs.first()?.window;
    inputs.iter().all(|s| s.window == w).then_some(w)
}

Try / catch

match merge_parquet_split_metadata(&inputs, &output, mixed) {
    Err(e) if e.to_string().contains("window") => {
        warn!("mixed-window merge rejected: {e:#}; regrouping by window");
        return regroup_by_window_and_retry(inputs);
    }
    other => other?,
}

Prevention

When it happens

Trigger: Calling merge_parquet_split_metadata with splits whose Optional window values differ — e.g. compaction selecting a time-windowed split together with a non-windowed (legacy) split, or splits created before/after the index's window configuration changed.

Common situations: Index window duration changed at runtime; a legacy promotion or migration left old non-windowed splits alongside new windowed ones; merge planner groups only by index_uid/partition and forgets the window dimension.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


AI-assisted analysis of quickwit-oss/quickwit@a39730c5cd (2026-09-08). Data as JSON: /api/errors/0fb0c756100b41a7. Report an issue: GitHub.