quickwit-oss/quickwit · error

input rg col ' ' has no min in stats — cannot determine…

Error message

input {input_idx} rg {rg_idx} col '{col_name}' has no min in stats — cannot determine prefix alignment

What it means

require_eq verifies that a row-group prefix column has min == max (a single constant value) using parquet statistics. When the statistics object reports no min (Option::None — possible for some parquet types/writers that omit min), the function cannot determine prefix alignment and errors out.

Solutions

  1. Rewrite input parquet files with a writer that records both min and max statistics.
  2. Check the parquet-rs version: very old files or nonstandard stats can yield None min; re-encode with the current writer.
  3. Verify the Statistics variant dispatch in encode_prefix_col_value matches the column's physical type (Boolean vs Int vs ByteArray).
Defensive patterns

Strategy: validation

Validate before calling

let stats = chunk.statistics().ok_or_else(|| anyhow!("no stats"))?;
if stats.min_bytes_opt().is_none() || stats.min_is_none() {
    return Err(anyhow!("chunk stats lack min"));
}

Try / catch

match err {
    e if e.to_string().contains("has no min in stats") => {
        // re-encode the input file with full statistics, then retry once
        rewrite_with_full_stats(input)?;
        retry_merge(input)?;
    }
    e => return Err(e),
}

Prevention

When it happens

Trigger: encode_prefix_col_value → require_eq called on a column chunk whose parquet Statistics variant carries a None min (writer omitted min, or stats order/variant unexpected), during extract_regions_from_metadata.

Common situations: Parquet files written by tools that only record max, or stats truncated/legacy format where min is signed-min-max ordering only; corrupted stats metadata.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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

Appendix: source

Thrown at quickwit/quickwit-parquet-engine/src/merge/streaming/region_grouping.rs:331

/// them either) and so are rejected up front.
fn encode_prefix_col_value(
    stats: &parquet::file::statistics::Statistics,
    col: &PrefixColumn,
    rg_idx: usize,
    input_idx: usize,
    key: &mut Vec<u8>,
) -> Result<()> {
    use parquet::file::statistics::Statistics;

    fn require_eq<T: PartialEq + std::fmt::Debug>(
        min: Option<T>,
        max: Option<T>,
        col_name: &str,
        rg_idx: usize,
        input_idx: usize,
    ) -> Result<T> {
        let min = min.ok_or_else(|| {
            anyhow!(
                "input {input_idx} rg {rg_idx} col '{col_name}' has no min in stats — cannot \
                 determine prefix alignment"
            )
        })?;
        let max = max.ok_or_else(|| {
            anyhow!(
                "input {input_idx} rg {rg_idx} col '{col_name}' has no max in stats — cannot \
                 determine prefix alignment"
            )
        })?;
        if min != max {
            bail!(
                "input {input_idx} rg {rg_idx} is NOT prefix-aligned on col '{col_name}': min \
                 ({:?}) != max ({:?}). Multi-RG inputs declaring `rg_partition_prefix_len >= 1` \
                 must carry one prefix-value per RG.",
                min,
                max,
            );

View on GitHub (pinned to a39730c5cd)