{"record":{"id":"c192a8e0c39dd8b6","repo":"influxdata/influxdb","slug":"no-max-time-statistic","errorCode":null,"errorMessage":"no max time statistic","messagePattern":"no max time statistic","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/parquet_file/src/metadata.rs","lineNumber":578,"sourceCode":"/// 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\n    /// [Zstandard]: http://facebook.github.io/zstd/","sourceCodeStart":560,"sourceCodeEnd":596,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/parquet_file/src/metadata.rs#L560-L596","documentation":"The mirror of the min case: derive_min_max_time expects stats.max to be Some for the I64 time statistics and panics otherwise. Without a max the file's upper time bound cannot be derived, which IOx needs for partition indexing.","triggerScenarios":"Same as min: calling derive_min_max_time/to_parquet_file where the time column statistics lack a max value — NULL-only time column or statistics disabled at write time.","commonSituations":"Unpopulated time columns in ingest, writers configured without statistics, truncated statistics blobs.","solutions":["Guarantee the time column is fully populated (no NULLs) before encoding","Enable column statistics in the Parquet writer properties","Regenerate the file from a validated RecordBatch"],"exampleFix":"// before\nlet batch = /* time column may contain nulls */;\n// after\nlet time = batch.column_by_name(\"time\").unwrap();\nassert_eq!(time.null_count(), 0);","handlingStrategy":"validation","validationCode":"let time = batch.column_by_name(\"time\").ok_or_else(|| anyhow!(\"no time col\"))?;\nif time.null_count() > 0 || time.len() == 0 { return Err(anyhow!(\"invalid time column\")); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never emit batches with NULL time values","Keep WriterProperties statistics enabled","Verify max statistic presence in integration tests"],"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"}