{"record":{"id":"66af80fb019065f4","repo":"influxdata/influxdb","slug":"failed-to-write-parquet-file-0","errorCode":null,"errorMessage":"failed to write parquet file: {0}","messagePattern":"failed to write parquet file: (.+?)","errorType":"error_code","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"core/parquet_file/src/writer.rs","lineNumber":21,"sourceCode":"\nuse arrow::{datatypes::SchemaRef, record_batch::RecordBatch};\nuse datafusion::{\n    error::DataFusionError,\n    execution::memory_pool::{MemoryConsumer, MemoryPool, MemoryReservation},\n};\nuse parquet::{\n    arrow::ArrowWriter,\n    errors::ParquetError,\n    file::{metadata::ParquetMetaData, properties::WriterProperties},\n};\nuse thiserror::Error;\nuse tracing::warn;\n\n/// Errors related to [`TrackedMemoryArrowWriter`]\n#[derive(Debug, Error)]\npub enum Error {\n    /// Writing the parquet file failed with the specified error.\n    #[error(\"failed to write parquet file: {0}\")]\n    Writer(#[from] ParquetError),\n\n    /// Could not allocate sufficient memory\n    #[error(\"failed to allocate buffer while writing parquet: {0}\")]\n    OutOfMemory(Box<DataFusionError>),\n}\n\n// Manual impl, see https://github.com/dtolnay/thiserror/issues/415\nimpl From<DataFusionError> for Error {\n    fn from(e: DataFusionError) -> Self {\n        Self::OutOfMemory(Box::new(e))\n    }\n}\n\n/// Results!\npub type Result<T, E = Error> = std::result::Result<T, E>;\n\n/// Wraps an [`ArrowWriter`] to track its buffered memory in a","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/parquet_file/src/writer.rs#L3-L39","documentation":"Error::Writer wraps an underlying arrow/parquet ParquetError produced by TrackedMemoryArrowWriter while serializing record batches to the parquet format. The library surfaces the raw ParquetError message prefixed with 'failed to write parquet file'.","triggerScenarios":"Writing record batches fails inside the tracked writer: unsupported data types for parquet, Arrow schema incompatible with the writer's schema, or an I/O failure on the underlying sink.","commonSituations":"Mismatch between the schema the writer was created with and the batches actually written; attempting to write dictionary/nested types unsupported by the chosen parquet version; disk full or object-store I/O errors.","solutions":["Inspect the inner ParquetError message for the root cause and fix accordingly","Ensure every batch written matches the schema the writer was created with","Check that the underlying sink (memory buffer/object store) is writable and has capacity"],"exampleFix":"// before\nlet writer = TrackedMemoryArrowWriter::new(sink, schema_a);\nwriter.write(batch_with_schema_b)?;\n// after\nassert_eq!(batch.schema(), schema_a, \"batch schema must match writer schema\");\nwriter.write(batch)?;","handlingStrategy":"try-catch","validationCode":"assert_eq!(batch.schema().as_ref(), writer_schema.as_ref(), \"batch schema must match writer schema\");","typeGuard":null,"tryCatchPattern":"match writer.write(batch) {\n    Err(e @ Error::Writer(pe)) => log::error!(\"parquet write failed: {pe}\"),\n    Err(e) => return Err(e.into()),\n    Ok(_) => (),\n}","preventionTips":["Always write batches whose schema matches the writer's schema","Verify sink writability/capacity before starting large writes"],"tags":["parquet","io","serialization"],"backgroundTag":"file-write-failed","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"}