influxdata/influxdb · error · Error

Arrow pretty printing error

Error message

Arrow pretty printing error: {}

What it means

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.

Solutions

  1. Inspect the wrapped ArrowError text after 'Arrow pretty printing error: ' for the real cause.
  2. Fall back to JSON or CSV output format via the Format enum to get the data anyway.
  3. Check that all record batches share a consistent schema before formatting.
  4. Align the arrow crate version of your client with the one used by influxdb_iox_client.

Example fix

// before
client.query(...).await?.pretty_print()?;
// after
match result.format(format::Format::Pretty) {
    Ok(p) => println!("{}", p),
    Err(format::Error::PrettyArrow(e)) => {
        eprintln!("pretty print failed: {e}; falling back to json");
        let j = result.format(format::Format::Json)?;
        println!("{}", j);
    }
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Rust: ensure batches exist and share a schema before pretty print
fn can_pretty_print(batches: &[RecordBatch]) -> bool {
    !batches.is_empty()
        && batches.windows(2).all(|w| w[0].schema() == w[1].schema())
}

Type guard

fn is_pretty_arrow_err(e: &format::Error) -> Option<&ArrowError> {
    match e { format::Error::PrettyArrow(a) => Some(a), _ => None }
}

Try / catch

match result.format(format::Format::Pretty) {
    Ok(p) => println!("{p}"),
    Err(format::Error::PrettyArrow(e)) => eprintln!("pretty print failed: {e}"),
    Err(e) => eprintln!("other format error: {e}"),
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of influxdata/influxdb@06200ef96b (2026-09-19). Data as JSON: /api/errors/ce3d2c466b981f7b. Report an issue: GitHub.

Appendix: source

Thrown at core/influxdb_iox_client/src/format.rs:22

use thiserror::Error;

use arrow::{
    self, csv::WriterBuilder, error::ArrowError, json::ArrayWriter, record_batch::RecordBatch,
};

/// Output formatting for InfluxQL.
pub mod influxql;

/// Error type for results formatting
#[derive(Debug, Error)]
pub enum Error {
    /// Unknown formatting type
    #[error("Unknown format type: {}. Expected one of 'pretty', 'csv' or 'json'", .0)]
    Invalid(String),

    /// Error pretty printing
    #[error("Arrow pretty printing error: {}", .0)]
    PrettyArrow(ArrowError),

    /// Error during CSV conversion
    #[error("Arrow csv printing error: {}", .0)]
    CsvArrow(ArrowError),

    /// Error during JSON conversion
    #[error("Arrow json printing error: {}", .0)]
    JsonArrow(ArrowError),

    /// Error converting CSV output to utf-8
    #[error("Error converting CSV output to UTF-8: {}", .0)]
    CsvUtf8(std::string::FromUtf8Error),

    /// Error converting JSON output to utf-8
    #[error("Error converting JSON output to UTF-8: {}", .0)]
    JsonUtf8(std::string::FromUtf8Error),
}

View on GitHub (pinned to 06200ef96b)