quickwit-oss/tantivy · error

unsupported

Error message

unsupported

What it means

Composite aggregation precomputation of the 'after' key cannot handle columns of type Bytes. Byte-column (bytes/JSON-ish) accessors have no precomputed after-key representation, so the code panics with 'unsupported'. Only I64/U64/F64/Str/Date-type accessors support precomputed pagination keys here.

Source

Thrown at src/aggregation/bucket/composite/accessors.rs:480

        })?;
        Ok(next_ord.into())
    }

    /// Projects the after key into the column space of the given accessor.
    ///
    /// The computed after key will not take care of skipping entire columns
    /// when the after key type is ordered after the accessor's type, that
    /// should be performed earlier.
    pub fn precompute(
        composite_accessor: &CompositeAccessor,
        source_after_key: &CompositeIntermediateKey,
        field: &str,
        missing_order: MissingOrder,
        order: Order,
    ) -> crate::Result<Self> {
        use CompositeIntermediateKey as CIKey;
        let precomputed_key = match (composite_accessor.column_type, source_after_key) {
            (ColumnType::Bytes, _) => panic!("unsupported"),
            // null after key
            (_, CIKey::Null) => precompute_missing_after_key(false, missing_order, order),
            // numerical
            (ColumnType::I64, CIKey::I64(k)) => PrecomputedAfterKey::Exact(k.to_u64()),
            (ColumnType::I64, CIKey::U64(k)) => num_proj::u64_to_i64(*k).into(),
            (ColumnType::I64, CIKey::F64(k)) => num_proj::f64_to_i64(*k).into(),
            (ColumnType::U64, CIKey::I64(k)) => num_proj::i64_to_u64(*k).into(),
            (ColumnType::U64, CIKey::U64(k)) => PrecomputedAfterKey::Exact(*k),
            (ColumnType::U64, CIKey::F64(k)) => num_proj::f64_to_u64(*k).into(),
            (ColumnType::F64, CIKey::I64(k)) => num_proj::i64_to_f64(*k).into(),
            (ColumnType::F64, CIKey::U64(k)) => num_proj::u64_to_f64(*k).into(),
            (ColumnType::F64, CIKey::F64(k)) => PrecomputedAfterKey::Exact(k.to_u64()),
            // boolean
            (ColumnType::Bool, CIKey::Bool(key)) => PrecomputedAfterKey::Exact(key.to_u64()),
            // string
            (ColumnType::Str, CIKey::Str(key)) => PrecomputedAfterKey::precompute_term_ord(
                &composite_accessor.str_dict_column,
                key,

View on GitHub (pinned to b5d8deb80c)

Solutions

  1. Change the composite source field to a supported type (u64/i64/f64/keyword-str/date) in the schema or mapping.
  2. If the field must stay bytes, avoid `after` pagination on it, or handle it via a separate non-precomputed path.
  3. Check the accessor's column_type at query-build time and reject bytes sources with a proper error instead of reaching precompute.

Example fix

// before
let precomputed = precompute(...source_after_key...); // panics for Bytes
// after
if composite_accessor.column_type == ColumnType::Bytes {
    return Err(TantivyError::InvalidArgument(
        "bytes fields are not supported as composite aggregation sources".into()));
}
let precomputed = precompute(...source_after_key...);
Defensive patterns

Strategy: validation

Validate before calling

if accessor.column_type == ColumnType::Bytes {
    return Err(InvalidArgument("bytes field not supported in composite source"));
}

Type guard

fn is_composite_supported(t: ColumnType) -> bool {
    !matches!(t, ColumnType::Bytes)
}

Prevention

When it happens

Trigger: Running a composite aggregation with a source whose column_type is ColumnType::Bytes (e.g. a `bytes` fast field, or a keyword field mapped to bytes storage) together with an after_key / pagination request, hitting precompute in accessors.rs.

Common situations: Paginating a composite aggregation over a bytes-backed field; a schema change moved a field from u64/keyword to bytes fast field; using raw-bytes fields as composite sources where only numeric/str/date are supported.

Related errors


AI-assisted analysis of quickwit-oss/tantivy@b5d8deb80c (2026-09-05). Data as JSON: /api/errors/b5bfdd671b32c8ed. Report an issue: GitHub.