{"record":{"id":"77edae181eef33e0","repo":"influxdata/influxdb","slug":"arrow-json-printing-error","errorCode":null,"errorMessage":"Arrow json printing error: {}","messagePattern":"Arrow json printing error: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"core/influxdb_iox_client/src/format.rs","lineNumber":30,"sourceCode":"pub 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}\ntype Result<T, E = Error> = std::result::Result<T, E>;\n\n#[derive(Debug, Copy, Clone, PartialEq, Eq, Default)]\n/// Requested output format for the query endpoint\npub enum QueryOutputFormat {\n    /// Arrow pretty printer format (default)\n    #[default]\n    Pretty,","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/influxdb_iox_client/src/format.rs#L12-L48","documentation":"This error is returned when converting query results to JSON via the arrow JSON writer fails. The inner ArrowError is wrapped and displayed after 'Arrow json printing error: '. It means `arrow::json::writer` could not serialize the RecordBatches.","triggerScenarios":"Calling the client's format function with Format::Json on batches the arrow JSON writer cannot handle, such as batches with invalid/null buffer layouts.","commonSituations":"Serializing results containing types unsupported by the installed arrow JSON writer, or data corrupted by an earlier mismatched arrow version.","solutions":["Inspect the wrapped ArrowError message for the failing column.","Validate batch buffer/schema integrity before formatting.","Try CSV or pretty output as an alternative rendering path.","Pin a consistent arrow version across the workspace."],"exampleFix":"// before\nlet json = result.format(format::Format::Json)?;\n// after\nlet json = result.format(format::Format::Json)\n    .map_err(|e| anyhow!(\"json export failed: {e}\"))?;","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"fn is_json_arrow_err(e: &format::Error) -> Option<&ArrowError> {\n    match e { format::Error::JsonArrow(a) => Some(a), _ => None }\n}","tryCatchPattern":"match result.format(format::Format::Json) {\n    Ok(j) => use_json(j),\n    Err(format::Error::JsonArrow(e)) => eprintln!(\"json write failed: {e}\"),\n    Err(e) => eprintln!(\"other format error: {e}\"),\n}","preventionTips":["Validate batch buffers and schema integrity before serialization","Avoid mixing arrow versions in one binary","Fall back to CSV or pretty output on JSON failure"],"tags":["arrow","json","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"}