influxdata/influxdb · error

num_row_groups_in_parallel should be above zero

Error message

num_row_groups_in_parallel should be above zero

What it means

This panic occurs in a builder method that configures how many row group writers the parquet writer should run in parallel. It converts the caller-supplied usize into a NonZeroUsize and panics via expect when the value is 0, because zero parallel row groups is meaningless for the writer pool.

Solutions

  1. Pass a num_row_group_writers value >= 1 when calling the builder
  2. Clamp or default the value before the call, e.g. n.max(1)
  3. Fix the config source so the parallelism setting cannot be 0

Example fix

// before
let opts = opts.with_row_group_writers(config.row_group_parallelism); // 0
// after
let n = config.row_group_parallelism.max(1);
let opts = opts.with_row_group_writers(n);
Defensive patterns

Strategy: validation

Validate before calling

assert!(num_row_group_writers > 0, "num_row_group_writers must be > 0");

Prevention

When it happens

Trigger: Calling the public builder (with_parquet_write_parallelization or equivalent on the storage options struct) passing num_row_group_writers = 0.

Common situations: Reading the parallelism level from config/env where a default of 0 slips through, or computing parallelism from a formula (e.g. num_cpus * factor) that yields 0 on constrained environments.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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

Appendix: source

Thrown at core/parquet_file/src/storage.rs:246

            parquet_write_parallelization_settings: Default::default(),
        }
    }

    /// Provide settings for parallelized writes. Settings determine the
    /// amount of parallelization per row group and per column.
    ///
    /// # Panics
    ///
    /// This will panic if an invalid usize (not > 0) is used.
    pub fn with_parallel_write_settings(
        self,
        num_row_group_writers: usize,
        num_column_writers_across_row_groups: usize,
    ) -> Self {
        Self {
            parquet_write_parallelization_settings: ParallelParquetWriterOptions::new(
                NonZeroUsize::new(num_row_group_writers)
                    .expect("num_row_groups_in_parallel should be above zero"),
                NonZeroUsize::new(num_column_writers_across_row_groups)
                    .expect("num_columns_in_parallel should be above zero"),
            ),
            ..self
        }
    }

    /// Get underlying object store.
    pub fn object_store(&self) -> &Arc<DynObjectStore> {
        &self.object_store
    }

    /// Get ID.
    pub fn id(&self) -> StorageId {
        self.id
    }

    /// Fake DataFusion context for testing that contains this store

View on GitHub (pinned to 06200ef96b)