{"record":{"id":"ad6961dd3197c8af","repo":"influxdata/influxdb","slug":"could-not-find-a-time-column","errorCode":null,"errorMessage":"Could not find a time column","messagePattern":"Could not find a time column","errorType":"error_code","errorClass":"TimestampMinMaxError","httpStatus":null,"severity":"error","filePath":"core/parquet_file/src/metadata.rs","lineNumber":1014,"sourceCode":"        .row_groups()\n        .iter()\n        .map(timestamp_min_max)\n        .collect::<Result<Vec<_>, _>>()?;\n    let file_timestamp_min_max = timestamp_min_maxes\n        .into_iter()\n        .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()","sourceCodeStart":996,"sourceCodeEnd":1032,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/parquet_file/src/metadata.rs#L996-L1032","documentation":"TimestampMinMaxError::NoTimeColumnFound — the Arrow schema derived from the Parquet file contains no 'time' column, so no timestamp range can be computed. The helper is IOx-specific and requires the standard time column.","triggerScenarios":"Calling the timestamp min/max extraction on a Parquet file whose schema lacks a column named 'time' (foreign files, renamed columns).","commonSituations":"Processing non-IOx Parquet files, schema migrations that renamed the time field, compaction outputs missing the time column.","solutions":["Verify the file's schema includes the 'time' column before extraction","Handle the NoTimeColumnFound variant and skip files that are not IOx-shaped","Ensure all write paths create the time column with TIME_COLUMN_NAME"],"exampleFix":"// caller-side guard\nlet fields: Vec<_> = schema.fields().iter().map(|f| f.name().as_str()).collect();\nif !fields.contains(&\"time\") { return Err(\"not an IOx file\"); }","handlingStrategy":"validation","validationCode":"let names: Vec<&str> = arrow_schema.fields().iter().map(|f| f.name().as_str()).collect();\nif !names.contains(&\"time\") { return Err(anyhow!(\"missing time column\")); }","typeGuard":"fn has_time(schema: &Schema) -> bool { schema.column_with_name(\"time\").is_some() }","tryCatchPattern":"match ts_min_max {\n    Err(TimestampMinMaxError::NoTimeColumnFound) => return Ok(TimestampRange::default()),\n    other => other?,\n}","preventionTips":["Guarantee every writer emits the 'time' column with TIME_COLUMN_NAME","Skip/reject non-IOx Parquet files early","Add schema checks at compaction and ingest boundaries"],"tags":["parquet","time-column","schema"],"backgroundTag":"missing-required-argument","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"}