@Override
    public void print(Iterator<RowData> it, PrintWriter printWriter) {
        if (!it.hasNext()) {
            printEmptyResult(it, printWriter);
            return;
        }
        long numRows = printTable(it, printWriter);
        printFooter(printWriter, numRows);
    }
@Test
    void testPrintWithMultipleRowsAndDeriveColumnWidthByContent() {
        PrintStyle.tableauWithDataInferredColumnWidths(
                        getSchema(),
                        getConverter(),
                        PrintStyle.DEFAULT_MAX_COLUMN_WIDTH,
                        true,
                        true)
                .print(getData().subList(0, 3).iterator(), new PrintWriter(outContent));

        assertThat(outContent.toString())
                .isEqualTo(
                        "+----+---------+------------+--------+---------+----------------+----------------------------+"
                                + System.lineSeparator()
                                + "| op | boolean |        int | bigint | varchar | decimal(10, 5) |                  timestamp |"
                                + System.lineSeparator()
                                + "+----+---------+------------+--------+---------+----------------+----------------------------+"
                                + System.lineSeparator()
                                + "| +I |         |          1 |      2 |     abc |        1.23000 | 2020-03-01 18:39:14.000000 |"
                                + System.lineSeparator()
                                + "| +I |   false |            |      0 |         |        1.00000 | 2020-03-01 18:39:14.100000 |"
                                + System.lineSeparator()
                                + "| -D |    true | 2147483647 |        | abcdefg |    12345.00000 | 2020-03-01 18:39:14.120000 |"
                                + System.lineSeparator()
                                + "+----+---------+------------+--------+---------+----------------+----------------------------+"
                                + System.lineSeparator()
                                + "3 rows in set"
                                + System.lineSeparator());
    }