{"record":{"id":"3e8b788e6a9a0af1","repo":"influxdata/influxdb","slug":"no-min-time-statistic","errorCode":null,"errorMessage":"no min time statistic","messagePattern":"no min time statistic","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/parquet_file/src/metadata.rs","lineNumber":577,"sourceCode":"/// A [`RecordBatch`] serialized without the embedded metadata found in the\n/// IOx [`Schema`] type will cause a statistic resolution failure due to\n/// lack of the IOx field type metadata for the time column. Batches\n/// produced from the through the IOx write path always include this\n/// metadata.\n///\n/// [`RecordBatch`]: arrow::record_batch::RecordBatch\npub fn derive_min_max_time(stats: Vec<ColumnSummary>) -> TimestampRange {\n    let time_summary = stats\n        .into_iter()\n        .find(|v| v.name == TIME_COLUMN_NAME)\n        .expect(\"no time column in metadata statistics\");\n\n    assert_eq!(time_summary.influxdb_type, InfluxDbType::Timestamp);\n\n    // Extract the min/max timestamps.\n    match time_summary.stats {\n        Statistics::I64(stats) => {\n            let min = Timestamp::new(stats.min.expect(\"no min time statistic\"));\n            let max = Timestamp::new(stats.max.expect(\"no max time statistic\"));\n            TimestampRange { min, max }\n        }\n        _ => panic!(\"unexpected physical type for timestamp column\"),\n    }\n}\n/// Parquet metadata with IOx-specific wrapper.\n#[derive(Clone, PartialEq, Eq)]\npub struct IoxParquetMetaData {\n    /// [Apache Parquet] metadata as freestanding [Apache Thrift]-encoded, and [Zstandard]-compressed bytes.\n    ///\n    /// This can be used to store metadata separate from the related payload data. The usage of [Apache Thrift] allows the\n    /// same stability guarantees as the usage of an ordinary [Apache Parquet] file. To encode a thrift message into bytes\n    /// the [Thrift Compact Protocol] is used.\n    ///\n    /// [Apache Parquet]: https://parquet.apache.org/\n    /// [Apache Thrift]: https://thrift.apache.org/\n    /// [Thrift Compact Protocol]: https://github.com/apache/thrift/blob/master/doc/specs/thrift-compact-protocol.md","sourceCodeStart":559,"sourceCodeEnd":595,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/parquet_file/src/metadata.rs#L559-L595","documentation":"After locating the time column's summary, derive_min_max_time expects the I64 statistics to carry a min value; if stats.min is None (no statistic recorded, e.g. an all-null page or missing statistics) it panics. IOx requires a bounded time range to index the file.","triggerScenarios":"Calling derive_min_max_time on summaries where the time column has no min statistic — typically a time column that is entirely NULL or a file written with statistics disabled.","commonSituations":"Batches where the time column was never populated (bug in ingestion code), files written with statistics off, empty row-group pages.","solutions":["Ensure the time column is never NULL before encoding the batch","Ensure Parquet writer statistics are enabled so min/max are recorded","Validate that time_column min statistic exists before calling to_parquet_file"],"exampleFix":"// caller-side validation\nlet time = batch.column_by_name(\"time\").unwrap();\nassert_eq!(time.null_count(), 0, \"time column must be non-null\");","handlingStrategy":"validation","validationCode":"let time = batch.column_by_name(\"time\").ok_or_else(|| anyhow!(\"no time col\"))?;\nif time.null_count() > 0 { return Err(anyhow!(\"null time values\")); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Enforce NOT NULL on the time column at ingest","Enable Parquet statistics so min/max are recorded","Test the write path with fully populated time columns"],"tags":["parquet","panic","statistics","null"],"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"}