Class TableauStyle

  • All Implemented Interfaces:
    PrintStyle

    @Internal
    public final class TableauStyle
    extends Object
    implements PrintStyle
    Print the result and content as tableau form.

    For example: (printRowKind is true)

     +----+-------------+---------+-------------+
     | op | boolean_col | int_col | varchar_col |
     +----+-------------+---------+-------------+
     | +I |        true |       1 |         abc |
     | -U |       false |       2 |         def |
     | +U |       false |       3 |         def |
     | -D |      <NULL> |  <NULL> |      <NULL> |
     +----+-------------+---------+-------------+
     4 rows in set
     
    • Method Detail

      • getColumnWidths

        @Nullable
        public int[] getColumnWidths()
        Returns null if the column widths are not precomputed using the row type.
      • print

        public void print​(Iterator<RowData> it,
                          PrintWriter printWriter)
        Description copied from interface: PrintStyle
        Displays the result.
        Specified by:
        print in interface PrintStyle
        Parameters:
        it - The iterator for the data to print
        printWriter - The writer to write to
      • printTable

        public long printTable​(Iterator<RowData> it,
                               PrintWriter printWriter)
        Print table with column names and borders.
        Returns:
        the row number printed in the table
      • printFooter

        public void printFooter​(PrintWriter printWriter,
                                long numRows)
      • inferColumnWidth

        public void inferColumnWidth​(List<String[]> rowData)
      • rowFieldsToString

        public String[] rowFieldsToString​(RowData row)
      • printColumnNamesTableauRow

        public void printColumnNamesTableauRow​(PrintWriter printWriter)
      • printTableauRow

        public void printTableauRow​(String[] cols,
                                    PrintWriter printWriter)
      • printBorderLine

        public void printBorderLine​(PrintWriter printWriter)