quickwit-oss/quickwit · error
no inputs to align
Error message
no inputs to align
What it means
align_inputs_to_union_schema computes the union schema of all input RecordBatches and aligns each batch to it. With zero inputs there is no schema to derive, so the function rejects the empty slice outright instead of returning a meaningless empty result.
Source
Thrown at quickwit/quickwit-parquet-engine/src/merge/schema.rs:59
/// Returns the union schema and a vector of batches where every batch has
/// exactly the same schema. Missing columns are filled with null arrays.
///
/// The union schema uses plain types for internal alignment: all string-like
/// types (Utf8, LargeUtf8, Dictionary) are normalized to Utf8 so that
/// `take` works uniformly across concatenated inputs. The actual output
/// file types are determined later by [`optimize_output_batch`] based on
/// each output file's data characteristics.
///
/// Columns are ordered in "Husky order":
/// 1. Sort schema columns (in configured order)
/// 2. `sorted_series` column
/// 3. Remaining columns in alphabetical order
pub fn align_inputs_to_union_schema(
inputs: &[RecordBatch],
sort_fields_str: &str,
) -> Result<(SchemaRef, Vec<RecordBatch>)> {
if inputs.is_empty() {
bail!("no inputs to align");
}
// Track each field's normalized type, whether any input declared
// it nullable, and how many of the input batches contain it. The
// union field is nullable iff some input observed it as nullable
// OR some input is missing the field entirely (a row from a
// missing-the-field input will be null in the merged output).
// The previous version always defaulted new fields to nullable on
// first sight, which broke columns whose nullability must be
// preserved (e.g. `List<Float64>` — the writer's non-nullable-
// list contract requires the union field to stay non-nullable).
struct FieldInfo {
normalized_type: DataType,
any_nullable: bool,
appears_in: usize,
}
let mut field_map: BTreeMap<String, FieldInfo> = BTreeMap::new();
View on GitHub (pinned to a39730c5cd)
Solutions
- Check inputs.is_empty() at the call site and return early (no output file) instead of invoking alignment.
- Ensure split/region producers never emit an empty batch list, or that empty regions are skipped upstream.
- If an empty merge is legitimate for your flow, handle it before calling align and emit an empty MergeOutputFile yourself if required.
Example fix
// before
let (schema, aligned) = align_inputs_to_union_schema(&batches, &sort)?;
// after
if batches.is_empty() {
return Ok(None); // nothing to merge for this region
}
let (schema, aligned) = align_inputs_to_union_schema(&batches, &sort)?; Defensive patterns
Strategy: validation
Validate before calling
if batches.is_empty() { return Ok(None); } // skip alignment for empty regions Try / catch
match align_inputs_to_union_schema(&batches, &sort) {
Err(e) if e.to_string() == "no inputs to align" => Ok(Vec::new()),
other => other.map(|_| ()),
} Prevention
- Filter out empty regions/splits before the alignment stage.
- Ensure batch collectors never emit empty vecs downstream.
- Unit-test the merge pipeline with zero-row splits.
When it happens
Trigger: Calling align_inputs_to_union_schema with an empty `&[RecordBatch]` — e.g. a region or split produced no batches, or upstream filtering removed every batch before alignment.
Common situations: Merging splits that turn out to contain zero rows after decoding; a caller that skips the is_empty check when collecting batches per region; pipeline stages that pass through empty vecs from upstream producers.
Understand the failure class
Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.
Related errors
- type conflict for column '{}': input 0 has {:?}, input {} ha
- sort schema '{}' does not contain a timestamp column
- input {} is missing column '{}'
- `{SORTED_SERIES_COLUMN}` must be Binary-typed
- append column: {}
AI-assisted analysis of quickwit-oss/quickwit@a39730c5cd (2026-09-08).
Data as JSON: /api/errors/f3045e836a6a2bfe.
Report an issue: GitHub.