{"record":{"id":"ce3d2c466b981f7b","repo":"influxdata/influxdb","slug":"arrow-pretty-printing-error","errorCode":null,"errorMessage":"Arrow pretty printing error: {}","messagePattern":"Arrow pretty printing error: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"core/influxdb_iox_client/src/format.rs","lineNumber":22,"sourceCode":"\nuse thiserror::Error;\n\nuse arrow::{\n    self, csv::WriterBuilder, error::ArrowError, json::ArrayWriter, record_batch::RecordBatch,\n};\n\n/// Output formatting for InfluxQL.\npub mod influxql;\n\n/// Error type for results formatting\n#[derive(Debug, Error)]\npub enum Error {\n    /// Unknown formatting type\n    #[error(\"Unknown format type: {}. Expected one of 'pretty', 'csv' or 'json'\", .0)]\n    Invalid(String),\n\n    /// Error pretty printing\n    #[error(\"Arrow pretty printing error: {}\", .0)]\n    PrettyArrow(ArrowError),\n\n    /// Error during CSV conversion\n    #[error(\"Arrow csv printing error: {}\", .0)]\n    CsvArrow(ArrowError),\n\n    /// Error during JSON conversion\n    #[error(\"Arrow json printing error: {}\", .0)]\n    JsonArrow(ArrowError),\n\n    /// Error converting CSV output to utf-8\n    #[error(\"Error converting CSV output to UTF-8: {}\", .0)]\n    CsvUtf8(std::string::FromUtf8Error),\n\n    /// Error converting JSON output to utf-8\n    #[error(\"Error converting JSON output to UTF-8: {}\", .0)]\n    JsonUtf8(std::string::FromUtf8Error),\n}","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/influxdb_iox_client/src/format.rs#L4-L40","documentation":"This error is returned by the influxdb_iox_client format module when pretty-printing query results as an Arrow table fails. The library wraps the underlying arrow::error::ArrowError verbatim, so the display message contains the arrow detail after 'Arrow pretty printing error: '. It means the arrow `pretty_format_batches` call itself could not render the RecordBatches.","triggerScenarios":"Calling the client's format function with Format::Pretty (or default pretty output) on query results whose schema/record batches cannot be rendered by the arrow pretty printer, e.g. corrupt or zero-schema batches.","commonSituations":"Pretty-printing unusual column types not supported by the pretty printer, mismatched schemas across batches, or arrow version incompatibilities where a datatype lacks a Display impl.","solutions":["Inspect the wrapped ArrowError text after 'Arrow pretty printing error: ' for the real cause.","Fall back to JSON or CSV output format via the Format enum to get the data anyway.","Check that all record batches share a consistent schema before formatting.","Align the arrow crate version of your client with the one used by influxdb_iox_client."],"exampleFix":"// before\nclient.query(...).await?.pretty_print()?;\n// after\nmatch result.format(format::Format::Pretty) {\n    Ok(p) => println!(\"{}\", p),\n    Err(format::Error::PrettyArrow(e)) => {\n        eprintln!(\"pretty print failed: {e}; falling back to json\");\n        let j = result.format(format::Format::Json)?;\n        println!(\"{}\", j);\n    }\n}","handlingStrategy":"try-catch","validationCode":"// Rust: ensure batches exist and share a schema before pretty print\nfn can_pretty_print(batches: &[RecordBatch]) -> bool {\n    !batches.is_empty()\n        && batches.windows(2).all(|w| w[0].schema() == w[1].schema())\n}","typeGuard":"fn is_pretty_arrow_err(e: &format::Error) -> Option<&ArrowError> {\n    match e { format::Error::PrettyArrow(a) => Some(a), _ => None }\n}","tryCatchPattern":"match result.format(format::Format::Pretty) {\n    Ok(p) => println!(\"{p}\"),\n    Err(format::Error::PrettyArrow(e)) => eprintln!(\"pretty print failed: {e}\"),\n    Err(e) => eprintln!(\"other format error: {e}\"),\n}","preventionTips":["Verify all record batches share an identical schema before formatting","Prefer JSON output when data contains exotic column types","Keep arrow crate versions aligned across your dependency tree"],"tags":["arrow","pretty-print","formatting"],"backgroundTag":"unsupported-dtype","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"}