influxdata/influxdb · error

no time column in metadata statistics

Error message

no time column in metadata statistics

What it means

derive_min_max_time scans the Vec<ColumnSummary> for a column named TIME_COLUMN_NAME ("time") and panics if none is present. The library requires every Parquet file it derives timestamps from to contain the IOx time column in its statistics. This is an invariant: a file without a time column is not a valid IOx Parquet file for this code path.

Solutions

  1. Ensure the Parquet file schema contains the 'time' column before calling to_parquet_file
  2. Check the writer used TIME_COLUMN_NAME when building the RecordBatch
  3. If processing foreign files, validate the schema up front and skip/reject them

Example fix

// caller-side validation
if !batch.schema().fields().iter().any(|f| f.name() == "time") {
    return Err(anyhow!("not an IOx parquet file: missing time column"));
}
Defensive patterns

Strategy: validation

Validate before calling

let has_time = batch.schema().fields().iter().any(|f| f.name() == "time");
if !has_time { return Err(anyhow!("missing time column")); }

Type guard

fn has_time_column(schema: &Schema) -> bool { schema.field_with_name("time").is_ok() }

Prevention

When it happens

Trigger: Calling derive_min_max_time (via to_parquet_file) with summaries from a Parquet file whose schema lacks the 'time' column, e.g. a non-IOx file or one written with the time column renamed/dropped.

Common situations: Pointing the tool at foreign Parquet files, schema migrations that renamed the time column, compaction code paths that dropped the time column.

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


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

Appendix: source

Thrown at core/parquet_file/src/metadata.rs:570

///
/// # Panics
///
/// This method panics if the [`IoxParquetMetaData`] structure does not
/// contain valid metadata bytes, has no readable schema, or has no field
/// statistics.
///
/// A [`RecordBatch`] serialized without the embedded metadata found in the
/// IOx [`Schema`] type will cause a statistic resolution failure due to
/// lack of the IOx field type metadata for the time column. Batches
/// produced from the through the IOx write path always include this
/// metadata.
///
/// [`RecordBatch`]: arrow::record_batch::RecordBatch
pub fn derive_min_max_time(stats: Vec<ColumnSummary>) -> TimestampRange {
    let time_summary = stats
        .into_iter()
        .find(|v| v.name == TIME_COLUMN_NAME)
        .expect("no time column in metadata statistics");

    assert_eq!(time_summary.influxdb_type, InfluxDbType::Timestamp);

    // Extract the min/max timestamps.
    match time_summary.stats {
        Statistics::I64(stats) => {
            let min = Timestamp::new(stats.min.expect("no min time statistic"));
            let max = Timestamp::new(stats.max.expect("no max time statistic"));
            TimestampRange { min, max }
        }
        _ => panic!("unexpected physical type for timestamp column"),
    }
}
/// Parquet metadata with IOx-specific wrapper.
#[derive(Clone, PartialEq, Eq)]
pub struct IoxParquetMetaData {
    /// [Apache Parquet] metadata as freestanding [Apache Thrift]-encoded, and [Zstandard]-compressed bytes.
    ///

View on GitHub (pinned to 06200ef96b)