influxdata/influxdb · error · ProjectionError

Unknown field

Error message

Unknown field: {0}

What it means

ProjectionError::UnknownField is raised when projecting a parquet file's schema onto an expected schema and a field present in the query/expected schema cannot be found in the file's schema. It carries the offending field name.

Solutions

  1. Verify the field name against the file's actual schema (parquet metadata) before projecting
  2. Handle files from older schema versions by excluding or defaulting missing fields
  3. Regenerate/re-write the file with the current schema if it is stale

Example fix

// before
let proj = schema.fields.iter().map(|f| f.name.clone());
// after
let file_fields: HashSet<_> = file_schema.fields.iter().map(|f| f.name.clone()).collect();
let proj: Vec<_> = schema.fields.iter().filter(|f| file_fields.contains(f.name())).collect();
Defensive patterns

Strategy: validation

Validate before calling

let file_names: HashSet<&str> = file_schema.fields.iter().map(|f| f.name().as_str()).collect();
let missing: Vec<_> = expected.fields.iter().filter(|f| !file_names.contains(f.name().as_str())).map(|f| f.name().clone()).collect();
if !missing.is_empty() { return Err(missing); }

Try / catch

match project(&file, &expected) {
    Err(ProjectionError::UnknownField(name)) => handle_missing_field(&name),
    Err(e) => return Err(e.into()),
    Ok(b) => b,
}

Prevention

When it happens

Trigger: Reading a parquet file whose schema lacks a column that the caller's projection/expected schema requires.

Common situations: Schema drift: querying an older parquet file for a column added later; a typo'd field name in a projection; mixing files written by different schema versions.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of influxdata/influxdb@06200ef96b (2026-09-19). Data as JSON: /api/errors/d8bc598f76fc4f14. Report an issue: GitHub.

Appendix: source

Thrown at core/parquet_file/src/storage.rs:445

                .expect("valid object store URL"),
            object_store: Arc::clone(&self.object_store),
            object_meta: ObjectMeta {
                location: path.object_store_path(),
                // we don't care about the "last modified" field
                last_modified: Default::default(),
                size: file_size,
                e_tag: None,
                version: None,
            },
        }
    }
}

/// Error during projecting parquet file data to an expected schema.
#[derive(Debug, Error)]
pub enum ProjectionError {
    /// Unknown field.
    #[error("Unknown field: {0}")]
    UnknownField(String),

    /// Field type mismatch
    #[error("Type mismatch, expected {expected:?} but got {actual:?}")]
    FieldTypeMismatch {
        /// Expected field.
        expected: Field,

        /// Actual field.
        actual: Field,
    },
}

#[cfg(test)]
mod tests {
    use super::*;
    use arrow::{
        array::{ArrayRef, Int64Array, StringArray},

View on GitHub (pinned to 06200ef96b)