{"record":{"id":"c4b750d7c318fb57","repo":"pola-rs/polars","slug":"invalid-value-for-polars-row-group-prefetch-size","errorCode":null,"errorMessage":"invalid value for POLARS_ROW_GROUP_PREFETCH_SIZE: {x}","messagePattern":"invalid value for POLARS_ROW_GROUP_PREFETCH_SIZE: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-stream/src/nodes/io_sources/parquet/builder.rs","lineNumber":76,"sourceCode":"        if matches!(\n            self.options.parallel,\n            ParallelStrategy::Auto | ParallelStrategy::Prefiltered\n        ) {\n            capabilities |= RC::FULL_FILTER;\n        }\n        capabilities\n    }\n\n    fn set_execution_state(&self, execution_state: &crate::execute::StreamingExecutionState) {\n        // Bound the number of fetches in the pipeline.\n        // This bound goes together with the `prefetch_kbytes_limit` bound. In most\n        // large-dataset use cases, the kbytes memory bound will kick in first.\n        // This limit should be at least as large as the max in-flight concurrency.\n        let prefetch_limit = std::env::var(\"POLARS_ROW_GROUP_PREFETCH_SIZE\")\n            .map(|x| {\n                x.parse::<NonZeroUsize>()\n                    .unwrap_or_else(|_| {\n                        panic!(\"invalid value for POLARS_ROW_GROUP_PREFETCH_SIZE: {x}\")\n                    })\n                    .get()\n            })\n            .unwrap_or(\n                execution_state\n                    .num_pipelines\n                    .saturating_mul(2)\n                    .max(get_request_budget() as usize)\n                    .clamp(16, 2048),\n            )\n            .max(1);\n\n        // Bound the max memory in use for the pipeline.\n        // This should be large enough to be non-blocking, but small enough to avoid\n        // excessive memory use from a run-away prefetch pipeline.\n        // \"Correct\" formula: (a) max effective in-flight bdp-based bytes budget + (b) decode pipeline.\n        // Since we do not know (a) at startup, we use  '3 * (b) + buffer' as a proxy for (a), where the\n        // multiplier reflects the max gain factor for in-flight control.","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/pola-rs/polars/blob/68506541d2de983056c9eb244e1ea05fab377dfc/crates/polars-stream/src/nodes/io_sources/parquet/builder.rs#L58-L94","documentation":"Panic in ParquetReaderBuilder::set_execution_state: POLARS_ROW_GROUP_PREFETCH_SIZE was set but is not a valid NonZeroUsize. The env var overrides the number of row groups prefetched into the decode pipeline (defaulting to a clamp of pipelines-based heuristic), so the bad value {x} aborts reader setup.","triggerScenarios":"Invalid value in POLARS_ROW_GROUP_PREFETCH_SIZE.","commonSituations":"See trigger scenarios.","solutions":["Set POLARS_ROW_GROUP_PREFETCH_SIZE to a positive integer or unset it."],"exampleFix":"export POLARS_ROW_GROUP_PREFETCH_SIZE=8","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"68506541d2de983056c9eb244e1ea05fab377dfc","analyzedAt":"2026-08-19T12:15:06.350Z","contentChangedAt":"2026-08-19T12:15:06.350Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}