{"record":{"id":"3cf8ebf65b4f53de","repo":"influxdata/influxdb","slug":"cannot-write-parquet-to-a-terminal-use-output-file-or-pipe","errorCode":null,"errorMessage":"cannot write parquet to a terminal, use `--output <file>` or pipe the output","messagePattern":"cannot write parquet to a terminal, use `--output <file>` or pipe the output","errorType":"error_code","errorClass":"Error::NoOutputFileForParquet","httpStatus":null,"severity":"error","filePath":"influxdb3_commands/src/query.rs","lineNumber":28,"sourceCode":"};\nuse url::Url;\n\nuse crate::common::Format;\n\nuse super::common::InfluxDb3Config;\n\n#[derive(Debug, thiserror::Error)]\npub enum Error {\n    #[error(transparent)]\n    Client(#[from] influxdb3_client::Error),\n\n    #[error(\"invlid UTF8 received from server: {0}\")]\n    Utf8(#[from] Utf8Error),\n\n    #[error(\"io error: {0}\")]\n    Io(#[from] io::Error),\n\n    #[error(\"cannot write parquet to a terminal, use `--output <file>` or pipe the output\")]\n    NoOutputFileForParquet,\n    #[error(\n        \"No input from stdin detected, no string was passed in,  and no file \\\n        path was given\"\n    )]\n    NoInput,\n}\n\npub type Result<T> = std::result::Result<T, Error>;\n\n#[derive(Debug, Parser)]\n#[clap(visible_alias = \"q\")]\npub struct Config {\n    /// Common InfluxDB 3 server config\n    #[clap(flatten)]\n    influxdb3_config: InfluxDb3Config,\n\n    /// Override host URL for query operations","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_commands/src/query.rs#L10-L46","documentation":"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.","triggerScenarios":"Running `influxdb3 query --output-format parquet ...` in an interactive terminal without `--output <file>` and with stdout not piped.","commonSituations":"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.","solutions":["Add `--output <file>` to the query command to write parquet to a file","Pipe stdout to a file or another process, e.g. `influxdb3 query ... > out.parquet`","Use a text output format (table/csv) if terminal display is intended"],"exampleFix":"// before\ninfluxdb3 query --output-format parquet \"SELECT * FROM weather\"\n// after\ninfluxdb3 query --output-format parquet --output ./out.parquet \"SELECT * FROM weather\"","handlingStrategy":"validation","validationCode":"// shell guard before running the CLI\nif [ -t 1 ] && [[ \"$ARGS\" == *parquet* ]]; then\n  echo \"stdout is a TTY: add --output <file> or pipe output\" >&2; exit 1\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass --output when requesting parquet output","In scripts, explicitly redirect stdout to a file","Prefer table/csv formats for interactive exploration"],"tags":["cli","parquet","terminal","output"],"backgroundTag":"invalid-cli-argument","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"}