{"record":{"id":"b3a1d264ca3ed8c7","repo":"pola-rs/polars","slug":"invalid-value-for-polars-row-group-prefetch-kbytes","errorCode":null,"errorMessage":"invalid value for POLARS_ROW_GROUP_PREFETCH_KBYTES_BUDGET: {x}","messagePattern":"invalid value for POLARS_ROW_GROUP_PREFETCH_KBYTES_BUDGET: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-stream/src/nodes/io_sources/parquet/builder.rs","lineNumber":102,"sourceCode":"                    .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.\n        // TODO: Dynamically adapt the max memory to the observed BDP.\n        // NOTE: This does not account for the decompression multiplier, so actual memory\n        // usage can be substantially larger.\n        let prefetch_kbytes_limit = std::env::var(\"POLARS_ROW_GROUP_PREFETCH_KBYTES_BUDGET\")\n            .map(|x| {\n                x.parse::<NonZeroUsize>()\n                    .unwrap_or_else(|_| {\n                        panic!(\"invalid value for POLARS_ROW_GROUP_PREFETCH_KBYTES_BUDGET: {x}\")\n                    })\n                    .get()\n            })\n            .unwrap_or({\n                let target_chunk_size_kb = FetchConfig::random_access().chunk_size.div_ceil(1024);\n                4 * execution_state.num_pipelines * target_chunk_size_kb\n            })\n            // Avoid deadlock.\n            .max(polars_io::cloud::concurrency_config::get_download_chunk_size().div_ceil(1024));\n\n        if config::verbose() {\n            eprintln!(\n                \"[ParquetReaderBuilder]: prefetch_limit: {}, prefetch_kbytes_limit: {}\",\n                prefetch_limit, prefetch_kbytes_limit\n            );\n        }\n\n        self.pipeline_budget","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/pola-rs/polars/blob/68506541d2de983056c9eb244e1ea05fab377dfc/crates/polars-stream/src/nodes/io_sources/parquet/builder.rs#L84-L120","documentation":"Panic in ParquetReaderBuilder::set_execution_state: POLARS_ROW_GROUP_PREFETCH_KBYTES_BUDGET was set but is not a valid NonZeroUsize. The env var overrides the kilobyte memory bound for the parquet prefetch pipeline; the unparsable string {x} panics before streaming begins.","triggerScenarios":"Invalid value in POLARS_ROW_GROUP_PREFETCH_KBYTES_BUDGET.","commonSituations":"See trigger scenarios.","solutions":["Set POLARS_ROW_GROUP_PREFETCH_KBYTES_BUDGET to a positive integer or unset it."],"exampleFix":"export POLARS_ROW_GROUP_PREFETCH_KBYTES_BUDGET=131072","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-14T05:17:10.506Z"}