{"record":{"id":"ccf5e80b0a1511c4","repo":"pola-rs/polars","slug":"i64-offsets-do-not-fit-in-i32-offsets","errorCode":null,"errorMessage":"i64 offsets do not fit in i32 offsets","messagePattern":"i64 offsets do not fit in i32 offsets","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-parquet/src/arrow/read/deserialize/mod.rs","lineNumber":64,"sourceCode":"}\n\n/// Creates a new [`ListArray`] or [`FixedSizeListArray`].\npub fn create_list(\n    dtype: ArrowDataType,\n    nested: &mut NestedState,\n    values: Box<dyn Array>,\n) -> Box<dyn Array> {\n    let (length, mut offsets, validity) = nested.pop().unwrap();\n    let validity = validity.and_then(freeze_validity);\n    match dtype.to_storage() {\n        ArrowDataType::List(_) => {\n            offsets.push(values.len() as i64);\n\n            let offsets = offsets.iter().map(|x| *x as i32).collect::<Vec<_>>();\n\n            let offsets: Offsets<i32> = offsets\n                .try_into()\n                .expect(\"i64 offsets do not fit in i32 offsets\");\n\n            Box::new(ListArray::<i32>::new(\n                dtype,\n                offsets.into(),\n                values,\n                validity,\n            ))\n        },\n        ArrowDataType::LargeList(_) => {\n            offsets.push(values.len() as i64);\n\n            Box::new(ListArray::<i64>::new(\n                dtype,\n                offsets.try_into().expect(\"List too large\"),\n                values,\n                validity,\n            ))\n        },","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/pola-rs/polars/blob/9b5d73fd00236295624374b075d16b1fe6ec6df9/crates/polars-parquet/src/arrow/read/deserialize/mod.rs#L46-L82","documentation":"expect in create_list when narrowing i64 row-offsets to i32 for an IPC ListArray: the total offsets exceed i32 range, so the array cannot be represented as a (non-large) list. Signals data larger than the 32-bit offset layout allows; read as LargeList.","triggerScenarios":"This panic/expect fires when execution reaches an unguarded state described by: \"i64 offsets do not fit in i32 offsets\". Typical triggers: unsupported dtype or feature-gated code path reached at runtime, invalid user input or environment variable value, calling API methods in the wrong order or on mismatched types, or data (lengths, offsets, ranges) violating the function's preconditions.","commonSituations":"Encountered when input data or configuration does not meet the preconditions of the throwing code path (\"i64 offsets do not fit in i32 offsets\"). Common cases: missing Cargo feature flags, mismatched dtypes/lengths between arrays or series, out-of-range temporal values, malformed environment variables, or operations on unsupported/complex nested types.","solutions":["The large (i64) list offsets exceed i32 range; split the data into smaller chunks or use large-list types end-to-end.","Filter/reduce the column so total element count fits in i32 offsets."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b5d73fd00236295624374b075d16b1fe6ec6df9","analyzedAt":"2026-08-19T12:15:06.350Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}