{"record":{"id":"b4cb07e058378cb7","repo":"pola-rs/polars","slug":"the-crate-was-compiled-without-ipc-compression-us","errorCode":null,"errorMessage":"The crate was compiled without IPC compression. Use `io_ipc_compression` to read compressed IPC.","messagePattern":"The crate was compiled without IPC compression\\. Use `io_ipc_compression` to read compressed IPC\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/polars-arrow/src/io/ipc/compression.rs","lineNumber":24,"sourceCode":"#[cfg(feature = \"io_ipc_compression\")]\n#[cfg_attr(docsrs, doc(cfg(feature = \"io_ipc_compression\")))]\npub fn decompress_lz4(input_buf: &[u8], output_buf: &mut [u8]) -> PolarsResult<()> {\n    use std::io::Read;\n    let mut decoder = lz4::Decoder::new(input_buf)?;\n    decoder.read_exact(output_buf).map_err(|e| e.into())\n}\n\n#[cfg(feature = \"io_ipc_compression\")]\n#[cfg_attr(docsrs, doc(cfg(feature = \"io_ipc_compression\")))]\npub fn decompress_zstd(input_buf: &[u8], output_buf: &mut [u8]) -> PolarsResult<()> {\n    use std::io::Read;\n    let mut decoder = zstd::Decoder::with_buffer(input_buf)?;\n    decoder.read_exact(output_buf).map_err(|e| e.into())\n}\n\n#[cfg(not(feature = \"io_ipc_compression\"))]\npub fn decompress_lz4(_input_buf: &[u8], _output_buf: &mut [u8]) -> PolarsResult<()> {\n    panic!(\n        \"The crate was compiled without IPC compression. Use `io_ipc_compression` to read compressed IPC.\"\n    );\n}\n\n#[cfg(not(feature = \"io_ipc_compression\"))]\npub fn decompress_zstd(_input_buf: &[u8], _output_buf: &mut [u8]) -> PolarsResult<()> {\n    panic!(\n        \"The crate was compiled without IPC compression. Use `io_ipc_compression` to read compressed IPC.\"\n    );\n}\n\n#[cfg(feature = \"io_ipc_compression\")]\n#[cfg_attr(docsrs, doc(cfg(feature = \"io_ipc_compression\")))]\npub fn compress_lz4(\n    input_buf: &[u8],\n    output_buf: &mut (impl std::io::Write + ?Sized),\n) -> PolarsResult<()> {\n    use std::io::Write;","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/crates/polars-arrow/src/io/ipc/compression.rs#L6-L42","documentation":"`decompress_lz4` is compiled as a stub when the `io_ipc_compression` cargo feature is disabled; calling it panics with this message. The Arrow IPC reader encountered an LZ4-compressed IPC record batch, but this build of polars-arrow cannot decompress it. The panic message points to the exact feature flag needed.","triggerScenarios":"Reading an Arrow IPC (Feather V2) file/stream whose record batches were written with LZ4 compression, while the crate was built without `features = [\"io_ipc_compression\"]`.","commonSituations":"Default dependency installs that omit the feature; reading IPC files produced by another tool (pyarrow, Spark) that compresses by default; after migrating from a feature-enabled build to a minimal build.","solutions":["Enable the feature in Cargo.toml: polars-arrow = { version = \"...\", features = [\"io_ipc_compression\"] } (or the corresponding `polars` feature `ipc_compression`).","Rewrite the IPC file uncompressed (read it with a compression-enabled build and re-save without compression).","Confirm the compression flag in the IPC file metadata before reading in compression-less builds."],"exampleFix":"// before\npolars-arrow = \"0.44\"\n\n// after\npolars-arrow = { version = \"0.44\", features = [\"io_ipc_compression\"] }","handlingStrategy":"validation","validationCode":"// build-time guard in your crate\ncfg_if::cfg_if! {\n    if #[cfg(not(feature = \"io_ipc_compression\"))] {\n        compile_error!(\"io_ipc_compression is required to read compressed Arrow IPC files\");\n    }\n}","typeGuard":null,"tryCatchPattern":"// rust: since it panics, intercept at the boundary\nlet result = std::panic::catch_unwind(|| reader.next_batch());\nmatch result {\n    Ok(batch) => batch,\n    Err(_) => return Err(\"IPC file is LZ4-compressed; rebuild with the io_ipc_compression feature\".into()),\n}","preventionTips":["Enable io_ipc_compression wherever Arrow IPC files are read.","Write IPC files uncompressed if consumers may use minimal builds.","Inspect IPC custom metadata (compression field) before dispatching to a compression-less reader.","Add a workspace-level feature aggregation so compression features propagate to all consumers."],"tags":["arrow","ipc","lz4","cargo-feature","panic"],"backgroundTag":"feature-not-enabled","analyzedSha":"fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e","analyzedAt":"2026-09-18T22:14:11.667Z","contentChangedAt":"2026-09-18T22:14:11.667Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}