influxdata/influxdb · error · TimestampMinMaxError

Expected time column to have type Int64; instead found

Error message

Expected time column to have type Int64; instead found {actual:?}

What it means

Thrown by TimestampMinMaxError::IncorrectTimeColumnType when the identified time column in a Parquet row group is not a Parquet Int64 physical type. The library only supports Int64-encoded timestamps for computing min/max ranges. The actual parquet::basic::Type is reported in the message.

Solutions

  1. Re-write the data so the time column uses Parquet INT64 (e.g. nanosecond/microsecond timestamps as i64)
  2. If reading legacy INT96 files, convert them to INT64 timestamps before ingesting into this library
  3. Check the Arrow-to-Parquet schema mapping so the timestamp column is written as Int64, not Int32
  4. Fix upstream schema definitions so the time column type is consistent across all written files

Example fix

// before: Schema::new(vec![Field::new("time", DataType::Int32, false)])
// after: Schema::new(vec![Field::new("time", DataType::Timestamp(TimeUnit::Nanosecond, None), false)]) // written as Parquet INT64
Defensive patterns

Strategy: validation

Validate before calling

let t = time_column_physical_type(&meta)?;
if t != parquet::basic::Type::INT64 {
    return Err(format!("time column must be INT64, got {:?}", t));
}

Try / catch

match res {
    Err(TimestampMinMaxError::IncorrectTimeColumnType { actual }) => {
        bail!("re-write file: time column is {:?}, need INT64", actual)
    }
    other => other?,
}

Prevention

When it happens

Trigger: timestamp_min_max() encounters a time column whose physical Parquet type is e.g. INT32, INT96, FLOAT, DOUBLE, BYTE_ARRAY, or FIXED_LEN_BYTE_ARRAY instead of INT64.

Common situations: Files written with millisecond timestamps stored as INT32, legacy INT96 timestamp columns from Spark/Impala exports, or schema drift where the time column type changed between writes.

Understand the failure class

Background: Type mismatch errors: IllegalArgumentException, TypeError and type guards across 150 open-source libraries — this error's family across 150 libraries.

Related errors


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

Appendix: source

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

        .reduce(|acc, i| acc.union(&i));

    Ok(file_timestamp_min_max)
}

/// Errors that may happen while collecting the min and max timestamps
#[expect(missing_docs)]
#[derive(Debug, Error)]
pub enum TimestampMinMaxError {
    #[error("Could not convert Parquet schema to Arrow schema: {0}")]
    SchemaConversion(#[from] parquet::errors::ParquetError),

    #[error("Could not find a time column")]
    NoTimeColumnFound,

    #[error("Could not find time column statistics")]
    NoColumnStatisticsFound,

    #[error("Expected time column to have type Int64; instead found {actual:?}")]
    IncorrectTimeColumnType { actual: parquet::basic::Type },
}

fn timestamp_min_max(
    row_group: &ParquetRowGroupMetaData,
) -> Result<TimestampMinMax, TimestampMinMaxError> {
    let statistics = row_group
        .columns()
        .iter()
        .find(|c| c.column_descr().name() == schema::TIME_COLUMN_NAME)
        .ok_or(TimestampMinMaxError::NoTimeColumnFound)?
        .statistics()
        .ok_or(TimestampMinMaxError::NoColumnStatisticsFound)?;

    match statistics {
        ParquetStatistics::Int64(inner_stats) => {
            let min = inner_stats
                .min_opt()

View on GitHub (pinned to 06200ef96b)