{"record":{"id":"7375d8f89bed7a07","repo":"influxdata/influxdb","slug":"row-count-overflows-i64","errorCode":null,"errorMessage":"row count overflows i64","messagePattern":"row count overflows i64","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/parquet_file/src/metadata.rs","lineNumber":491,"sourceCode":"        let columns: Vec<_> = stats.iter().map(|v| column_id_map(&v.name)).collect();\n\n        // Extract the min/max timestamps.\n        let TimestampRange {\n            min: min_time,\n            max: max_time,\n        } = derive_min_max_time(stats);\n\n        ParquetFileParams {\n            namespace_id: self.namespace_id,\n            table_id: self.table_id,\n            partition_id,\n            partition_hash_id,\n            object_store_id: self.object_store_id,\n            min_time,\n            max_time,\n            file_size_bytes: file_size_bytes as i64,\n            compaction_level: self.compaction_level,\n            row_count: row_count.try_into().expect(\"row count overflows i64\"),\n            column_set: ColumnSet::new(columns),\n            max_l0_created_at: self.max_l0_created_at,\n            // Currently, we're only setting the `source` field if the Parquet file is being\n            // created by bulk ingest, which does not use this code path. So for now, always set\n            // `source` to `None` here.\n            source: None,\n        }\n    }\n\n    /// Estimate the memory consumption of this object and its contents\n    pub fn size(&self) -> usize {\n        // size of this structure, including inlined size + heap sizes\n        let size_without_sortkey_refs = mem::size_of_val(self)\n            + self.namespace_name.len()\n            + self.table_name.len()\n            + std::mem::size_of::<PartitionKey>();\n\n        if let Some(sort_key) = self.sort_key.as_ref() {","sourceCodeStart":473,"sourceCodeEnd":509,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/parquet_file/src/metadata.rs#L473-L509","documentation":"Panicked in ParquetFileParams construction because the Parquet file's total row count does not fit in an i64, which the database schema requires. On any real system row counts are far below i64::MAX, so hitting this indicates a corrupted or nonsensical row-group count in the metadata.","triggerScenarios":"Calling ParquetFileParams::new on metadata with a row count summing above i64::MAX, typically from corrupt/fabricated row group metadata.","commonSituations":"Corrupted Parquet footers, adversarial/malformed input files, integer overflow in upstream row-count accounting.","solutions":["Inspect the Parquet footer row-group counts for corruption and re-encode the file","Verify the source of the metadata (never trust unvalidated external footers)","If genuinely huge, no fix exists in this schema — the row count must fit i64; reject the file upstream"],"exampleFix":"// caller-side guard before ParquetFileParams::new\nassert!(row_count <= i64::MAX as u64, \"rejecting file with impossible row count\");","handlingStrategy":"validation","validationCode":"if row_count > i64::MAX as u64 { return Err(anyhow!(\"row count exceeds i64\")); }","typeGuard":"fn fits_i64(n: u64) -> bool { n <= i64::MAX as u64 }","tryCatchPattern":"std::panic::catch_unwind(|| ParquetFileParams::new(...)) with a conversion to Result","preventionTips":["Validate row counts from untrusted footers before constructing params","Treat u64 row counts > i64::MAX as corrupted input and reject the file"],"tags":["parquet","overflow","panic","i64"],"backgroundTag":"value-out-of-range","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"}