presto-cli/src/main/java/io/prestosql/cli/Query.java/Query/sendOutput
class Query:    private void sendOutput(PrintStream out, OutputFormat format, List<Column> fieldNames)
            throws IOException
    {
        try (OutputHandler handler = createOutputHandler(format, createWriter(out), fieldNames)) {
            handler.processRows(client);
        }
    }