influxdata/influxdb · error · Error::NoOutputFileForParquet

cannot write parquet to a terminal, use `--output

Error message

cannot write parquet to a terminal, use `--output <file>` or pipe the output

What it means

The influxdb3 CLI `query` command refuses to write parquet query results directly to a terminal (stdout when attached to a TTY). Parquet is a binary format; printing it to a terminal produces garbage and can corrupt the terminal state. The user must redirect it to a file with `--output <file>` or pipe stdout elsewhere.

Solutions

  1. Add `--output <file>` to the query command to write parquet to a file
  2. Pipe stdout to a file or another process, e.g. `influxdb3 query ... > out.parquet`
  3. Use a text output format (table/csv) if terminal display is intended

Example fix

// before
influxdb3 query --output-format parquet "SELECT * FROM weather"
// after
influxdb3 query --output-format parquet --output ./out.parquet "SELECT * FROM weather"
Defensive patterns

Strategy: validation

Validate before calling

// shell guard before running the CLI
if [ -t 1 ] && [[ "$ARGS" == *parquet* ]]; then
  echo "stdout is a TTY: add --output <file> or pipe output" >&2; exit 1
fi

Prevention

When it happens

Trigger: Running `influxdb3 query --output-format parquet ...` in an interactive terminal without `--output <file>` and with stdout not piped.

Common situations: Developer runs the query CLI in a shell without redirecting output; scripts accidentally run parquet output in a TTY-attached foreground job; forgetting the --output flag when switching output format from csv/table to parquet.

Understand the failure class

Background: "Unknown argument", "Invalid value", and "must be one of": invalid CLI argument errors explained — this error's family across 35 libraries.

Related errors


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

Appendix: source

Thrown at influxdb3_commands/src/query.rs:28

};
use url::Url;

use crate::common::Format;

use super::common::InfluxDb3Config;

#[derive(Debug, thiserror::Error)]
pub enum Error {
    #[error(transparent)]
    Client(#[from] influxdb3_client::Error),

    #[error("invlid UTF8 received from server: {0}")]
    Utf8(#[from] Utf8Error),

    #[error("io error: {0}")]
    Io(#[from] io::Error),

    #[error("cannot write parquet to a terminal, use `--output <file>` or pipe the output")]
    NoOutputFileForParquet,
    #[error(
        "No input from stdin detected, no string was passed in,  and no file \
        path was given"
    )]
    NoInput,
}

pub type Result<T> = std::result::Result<T, Error>;

#[derive(Debug, Parser)]
#[clap(visible_alias = "q")]
pub struct Config {
    /// Common InfluxDB 3 server config
    #[clap(flatten)]
    influxdb3_config: InfluxDb3Config,

    /// Override host URL for query operations

View on GitHub (pinned to 06200ef96b)