{"record":{"id":"7fefa11c66bc00d3","repo":"influxdata/influxdb","slug":"expected-time-column-to-have-type-int64-instead-found-actual","errorCode":null,"errorMessage":"Expected time column to have type Int64; instead found {actual:?}","messagePattern":"Expected time column to have type Int64; instead found (.+?)","errorType":"error_code","errorClass":"TimestampMinMaxError","httpStatus":null,"severity":"error","filePath":"core/parquet_file/src/metadata.rs","lineNumber":1020,"sourceCode":"        .reduce(|acc, i| acc.union(&i));\n\n    Ok(file_timestamp_min_max)\n}\n\n/// Errors that may happen while collecting the min and max timestamps\n#[expect(missing_docs)]\n#[derive(Debug, Error)]\npub enum TimestampMinMaxError {\n    #[error(\"Could not convert Parquet schema to Arrow schema: {0}\")]\n    SchemaConversion(#[from] parquet::errors::ParquetError),\n\n    #[error(\"Could not find a time column\")]\n    NoTimeColumnFound,\n\n    #[error(\"Could not find time column statistics\")]\n    NoColumnStatisticsFound,\n\n    #[error(\"Expected time column to have type Int64; instead found {actual:?}\")]\n    IncorrectTimeColumnType { actual: parquet::basic::Type },\n}\n\nfn timestamp_min_max(\n    row_group: &ParquetRowGroupMetaData,\n) -> Result<TimestampMinMax, TimestampMinMaxError> {\n    let statistics = row_group\n        .columns()\n        .iter()\n        .find(|c| c.column_descr().name() == schema::TIME_COLUMN_NAME)\n        .ok_or(TimestampMinMaxError::NoTimeColumnFound)?\n        .statistics()\n        .ok_or(TimestampMinMaxError::NoColumnStatisticsFound)?;\n\n    match statistics {\n        ParquetStatistics::Int64(inner_stats) => {\n            let min = inner_stats\n                .min_opt()","sourceCodeStart":1002,"sourceCodeEnd":1038,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/parquet_file/src/metadata.rs#L1002-L1038","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Re-write the data so the time column uses Parquet INT64 (e.g. nanosecond/microsecond timestamps as i64)","If reading legacy INT96 files, convert them to INT64 timestamps before ingesting into this library","Check the Arrow-to-Parquet schema mapping so the timestamp column is written as Int64, not Int32","Fix upstream schema definitions so the time column type is consistent across all written files"],"exampleFix":"// before: Schema::new(vec![Field::new(\"time\", DataType::Int32, false)])\n// after: Schema::new(vec![Field::new(\"time\", DataType::Timestamp(TimeUnit::Nanosecond, None), false)]) // written as Parquet INT64","handlingStrategy":"validation","validationCode":"let t = time_column_physical_type(&meta)?;\nif t != parquet::basic::Type::INT64 {\n    return Err(format!(\"time column must be INT64, got {:?}\", t));\n}","typeGuard":null,"tryCatchPattern":"match res {\n    Err(TimestampMinMaxError::IncorrectTimeColumnType { actual }) => {\n        bail!(\"re-write file: time column is {:?}, need INT64\", actual)\n    }\n    other => other?,\n}","preventionTips":["Standardise on Arrow Timestamp with nanosecond/microsecond unit for time columns","Reject legacy INT96 sources at ingestion time, converting them to INT64 first","Pin a schema registry so the time column type cannot drift between writers"],"tags":["parquet","type-mismatch","time-column","schema"],"backgroundTag":"type-mismatch","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}