influxdata/influxdb · error

row count overflows i64

Error message

row count overflows i64

What it means

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.

Solutions

  1. Inspect the Parquet footer row-group counts for corruption and re-encode the file
  2. Verify the source of the metadata (never trust unvalidated external footers)
  3. If genuinely huge, no fix exists in this schema — the row count must fit i64; reject the file upstream

Example fix

// caller-side guard before ParquetFileParams::new
assert!(row_count <= i64::MAX as u64, "rejecting file with impossible row count");
Defensive patterns

Strategy: validation

Validate before calling

if row_count > i64::MAX as u64 { return Err(anyhow!("row count exceeds i64")); }

Type guard

fn fits_i64(n: u64) -> bool { n <= i64::MAX as u64 }

Try / catch

std::panic::catch_unwind(|| ParquetFileParams::new(...)) with a conversion to Result

Prevention

When it happens

Trigger: Calling ParquetFileParams::new on metadata with a row count summing above i64::MAX, typically from corrupt/fabricated row group metadata.

Common situations: Corrupted Parquet footers, adversarial/malformed input files, integer overflow in upstream row-count accounting.

Understand the failure class

Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.

Related errors


AI-assisted analysis of influxdata/influxdb@06200ef96b (2026-09-19). Data as JSON: /api/errors/7375d8f89bed7a07. Report an issue: GitHub.

Appendix: source

Thrown at core/parquet_file/src/metadata.rs:491

        let columns: Vec<_> = stats.iter().map(|v| column_id_map(&v.name)).collect();

        // Extract the min/max timestamps.
        let TimestampRange {
            min: min_time,
            max: max_time,
        } = derive_min_max_time(stats);

        ParquetFileParams {
            namespace_id: self.namespace_id,
            table_id: self.table_id,
            partition_id,
            partition_hash_id,
            object_store_id: self.object_store_id,
            min_time,
            max_time,
            file_size_bytes: file_size_bytes as i64,
            compaction_level: self.compaction_level,
            row_count: row_count.try_into().expect("row count overflows i64"),
            column_set: ColumnSet::new(columns),
            max_l0_created_at: self.max_l0_created_at,
            // Currently, we're only setting the `source` field if the Parquet file is being
            // created by bulk ingest, which does not use this code path. So for now, always set
            // `source` to `None` here.
            source: None,
        }
    }

    /// Estimate the memory consumption of this object and its contents
    pub fn size(&self) -> usize {
        // size of this structure, including inlined size + heap sizes
        let size_without_sortkey_refs = mem::size_of_val(self)
            + self.namespace_name.len()
            + self.table_name.len()
            + std::mem::size_of::<PartitionKey>();

        if let Some(sort_key) = self.sort_key.as_ref() {

View on GitHub (pinned to 06200ef96b)