prestodb/presto · error · RuntimeException
not supported
Error message
not supported
What it means
Query.createOutputPrinter switches over the requested --output-format and throws if none of the known cases (CSV, TSV, TSV_HEADER, JSON, NULL) match. The message is the raw format string plus ' not supported', indicating an unrecognized output format value.
Source
Thrown at presto-cli/src/main/java/com/facebook/presto/cli/Query.java:345
switch (format) {
case ALIGNED:
return new AlignedTablePrinter(fieldNames, writer);
case VERTICAL:
return new VerticalRecordPrinter(fieldNames, writer);
case CSV:
return new CsvPrinter(fieldNames, writer, false);
case CSV_HEADER:
return new CsvPrinter(fieldNames, writer, true);
case TSV:
return new TsvPrinter(fieldNames, writer, false);
case TSV_HEADER:
return new TsvPrinter(fieldNames, writer, true);
case JSON:
return new JsonPrinter(fieldNames, writer);
case NULL:
return new NullPrinter();
}
throw new RuntimeException(format + " not supported");
}
private static Writer createWriter(OutputStream out)
{
return new OutputStreamWriter(out, UTF_8);
}
@Override
public void close()
{
client.close();
}
public void renderFailure(PrintStream out)
{
QueryStatusInfo results = client.finalStatusInfo();
QueryError error = results.getError();
checkState(error != null);View on GitHub (pinned to 55bb57d202)
Solutions
- Use a supported value: ALIGNED, VERTICAL, CSV, CSV_HEADER, TSV, TSV_HEADER, JSON, NULL (check presto --help)
- Match the exact spelling/case of the enum constant
- Update old scripts that reference a format removed in this CLI version
Example fix
// before presto --output-format excel --execute "SELECT 1" // after presto --output-format CSV --execute "SELECT 1"
Defensive patterns
Strategy: validation
Validate before calling
// validate format against supported set before invoking
const VALID = ["ALIGNED","VERTICAL","CSV","CSV_HEADER","TSV","TSV_HEADER","JSON","NULL"];
if (!VALID.includes(format)) throw new Error(`Unsupported output format: ${format}`); Try / catch
try { runCli("--output-format", fmt, ...); } catch (RuntimeException e) { if (e.getMessage().endsWith(" not supported")) { /* retry with CSV default */ } else throw e; } Prevention
- Copy format names exactly from presto --help
- Validate format strings in scripts against the enum
- Note that matching is case-sensitive
When it happens
Trigger: Passing an --output-format value that doesn't match the enum (case-sensitive or misspelled, e.g. 'csv_json', 'text', 'ALIGNED' typo) to createOutputPrinter via createOutputHandler.
Common situations: Misspelling the format in scripts; assuming case-insensitivity (e.g. 'csv' vs 'CSV'); copying a format name from another tool (e.g. 'vertical').
Related errors
- INVALID_FUNCTION_ARGUMENT
- both --execute and --file specified
- Error reading from file %s: %s
- No console from which to read password
- Interrupted while preprocessing query
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/4916d4714c746cac.
Report an issue: GitHub.