presto-cli/src/main/java/io/prestosql/cli/CsvPrinter.java/CsvPrinter/printRows
class CsvPrinter:    @Override
    public void printRows(List<List<?>> rows, boolean complete)
            throws IOException
    {
        if (needHeader) {
            needHeader = false;
            writer.writeNext(toStrings(fieldNames));
        }

        for (List<?> row : rows) {
            writer.writeNext(toStrings(row));
            checkError();
        }
    }