{"record":{"id":"006529e62a160663","repo":"influxdata/influxdb","slug":"num-columns-in-parallel-should-be-above-zero","errorCode":null,"errorMessage":"num_columns_in_parallel should be above zero","messagePattern":"num_columns_in_parallel should be above zero","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/parquet_file/src/storage.rs","lineNumber":248,"sourceCode":"    }\n\n    /// Provide settings for parallelized writes. Settings determine the\n    /// amount of parallelization per row group and per column.\n    ///\n    /// # Panics\n    ///\n    /// This will panic if an invalid usize (not > 0) is used.\n    pub fn with_parallel_write_settings(\n        self,\n        num_row_group_writers: usize,\n        num_column_writers_across_row_groups: usize,\n    ) -> Self {\n        Self {\n            parquet_write_parallelization_settings: ParallelParquetWriterOptions::new(\n                NonZeroUsize::new(num_row_group_writers)\n                    .expect(\"num_row_groups_in_parallel should be above zero\"),\n                NonZeroUsize::new(num_column_writers_across_row_groups)\n                    .expect(\"num_columns_in_parallel should be above zero\"),\n            ),\n            ..self\n        }\n    }\n\n    /// Get underlying object store.\n    pub fn object_store(&self) -> &Arc<DynObjectStore> {\n        &self.object_store\n    }\n\n    /// Get ID.\n    pub fn id(&self) -> StorageId {\n        self.id\n    }\n\n    /// Fake DataFusion context for testing that contains this store\n    pub fn test_df_context(&self) -> SessionContext {\n        // set up \"fake\" DataFusion session","sourceCodeStart":230,"sourceCodeEnd":266,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/parquet_file/src/storage.rs#L230-L266","documentation":"This panic occurs in a builder method that configures how many column writers across row groups run in parallel. The usize is converted to NonZeroUsize and the expect panics when the caller passes 0, since at least one column writer must exist.","triggerScenarios":"Calling the public builder passing num_column_writers_across_row_groups = 0.","commonSituations":"Unset config field defaulting to 0, or derived parallelism calculations (e.g. width / chunk_size) that round down to 0 for narrow schemas.","solutions":["Pass a num_column_writers_across_row_groups value >= 1","Clamp to at least 1 before the call with n.max(1)","Correct the configuration/computation that produced 0"],"exampleFix":"// before\nwriter.with_column_writers(schema.width / chunk_size); // may be 0\n// after\nwriter.with_column_writers((schema.width / chunk_size).max(1));","handlingStrategy":"validation","validationCode":"assert!(num_column_writers_across_row_groups > 0, \"num_column_writers_across_row_groups must be > 0\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Default unset config values to a sane minimum (e.g. 1) instead of 0","Guard derived parallelism formulas against division/rounding to zero"],"tags":["panic","parquet","configuration","parallelism"],"backgroundTag":"invalid-config-value","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"}