influxdata/influxdb · error · Error
Arrow error
Error message
Arrow error: {} What it means
This error variant wraps an Apache Arrow error (arrow::error::ArrowError) encountered while formatting query results into InfluxQL line-protocol-style output. The influxql formatter in the influxdb_iox_client crate surfaces any Arrow-level failure (e.g., during record batch access, column conversion, or pretty printing) as Error::Arrow, preserving the underlying message via its Display impl 'Arrow error: {}'.
Solutions
- Print the inner ArrowError message (source chain) to identify the actual Arrow-level failure
- Check the arrow-rs version of the client vs the server's Arrow IPC format and align them with cargo update
- Inspect the schema of the returned batches (e.g., print batch.schema()) and ensure column types are ones the InfluxQL formatter supports
- If the failure is a downcast of a specific column, convert that column (e.g., cast to Utf8) before formatting or use the json formatter instead
Example fix
// before
let formatted = influxql_formatter.format(&batches).map_err(|e| anyhow!(e))?;
// after
let formatted = influxql_formatter.format(&batches).map_err(|e| {
if let Some(src) = e.source() {
anyhow::anyhow!("influxql format failed: {e}; caused by: {src}")
} else {
anyhow::anyhow!("influxql format failed: {e}")
}
})?; Defensive patterns
Strategy: try-catch
Validate before calling
// inspect batches before formatting
for b in batches {
for (i, col) in b.columns().iter().enumerate() {
assert_eq!(col.len(), b.num_rows(), "column {} length mismatch", i);
}
} Type guard
fn is_arrow_error(e: &influxql_format::Error) -> bool {
matches!(e, influxql_format::Error::Arrow(_))
} Try / catch
match formatter.format(&batches) {
Ok(out) => println!("{out}"),
Err(influxql_format::Error::Arrow(src)) => {
eprintln!("arrow failure while formatting: {src}");
}
Err(e) => return Err(e.into()),
} Prevention
- Keep arrow-rs/datafusion versions aligned with the server's IPC format
- Validate batch schemas and column lengths before passing to formatters
- Prefer the json formatter for arbitrary/unknown column types
When it happens
Trigger: Calling the InfluxQL results formatter (format::influxql::Formatter) when the underlying arrow::RecordBatch or schema access fails — e.g., ArrowError from downcasting column arrays to an unsupported type, computing with mismatched batch schemas, or Arrow I/O errors while reading batches.
Common situations: Querying a server that returns Arrow data with an unexpected column type not supported by the formatter; using an arrow-rs version whose ArrowError differs (datafusion/arrow version mismatch); malformed or truncated Arrow IPC responses from a misconfigured/older InfluxDB IOx server.
Understand the failure class
Background: Type mismatch errors: IllegalArgumentException, TypeError and type guards across 150 open-source libraries — this error's family across 150 libraries.
Related errors
- Arrow csv printing error
- Arrow json printing error
- Arrow pretty printing error
- Invalid InfluxQL metadata
- Missing InfluxQL metadata
AI-assisted analysis of influxdata/influxdb@06200ef96b (2026-09-19).
Data as JSON: /api/errors/26a733efb5bfd493.
Report an issue: GitHub.
Appendix: source
Thrown at core/influxdb_iox_client/src/format/influxql.rs:16
use arrow::array::{Array, ArrayData, StringArray};
use arrow::datatypes::DataType;
use arrow::error::ArrowError;
use arrow::record_batch::RecordBatch;
use arrow::util::display::ArrayFormatter;
use comfy_table::{Cell, Table};
use generated_types::influxdata::iox::querier::v1::InfluxQlMetadata;
use std::io::Write;
use std::iter;
use thiserror::Error;
/// Error type for results formatting
#[derive(Debug, Error)]
pub enum Error {
/// Arrow error.
#[error("Arrow error: {}", .0)]
Arrow(ArrowError),
/// [`InfluxQlMetadata`] not found in Arrow schema metadata.
#[error("Missing InfluxQL metadata")]
MissingMetadata,
/// Error deserializing [`InfluxQlMetadata`] from Arrow schema metadata.
#[error("Invalid InfluxQL metadata: {0}")]
InvalidMetadata(#[from] serde_json::Error),
/// Error writing formatted output.
#[error("Error writing output: {0}")]
Write(#[from] std::io::Error),
}
type Result<T, E = Error> = std::result::Result<T, E>;
/// Options for controlling how table borders are rendered.
#[derive(Debug, Default, Clone, Copy)]View on GitHub (pinned to 06200ef96b)