Class TableauStyle
- java.lang.Object
-
- org.apache.flink.table.utils.print.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
-
-
Field Summary
-
Fields inherited from interface org.apache.flink.table.utils.print.PrintStyle
DEFAULT_MAX_COLUMN_WIDTH, NULL_VALUE
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int[]
getColumnWidths()
Returns null if the column widths are not precomputed using the row type.void
inferColumnWidth(List<String[]> rowData)
void
print(Iterator<RowData> it, PrintWriter printWriter)
Displays the result.void
printBorderLine(PrintWriter printWriter)
void
printColumnNamesTableauRow(PrintWriter printWriter)
void
printEmptyResult(Iterator<RowData> it, PrintWriter printWriter)
void
printFooter(PrintWriter printWriter, long numRows)
long
printTable(Iterator<RowData> it, PrintWriter printWriter)
Print table with column names and borders.void
printTableauRow(String[] cols, PrintWriter printWriter)
String[]
rowFieldsToString(RowData row)
-
-
-
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 interfacePrintStyle
- Parameters:
it
- The iterator for the data to printprintWriter
- The writer to write to
-
printEmptyResult
public void printEmptyResult(Iterator<RowData> it, PrintWriter printWriter)
-
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)
-
printColumnNamesTableauRow
public void printColumnNamesTableauRow(PrintWriter printWriter)
-
printTableauRow
public void printTableauRow(String[] cols, PrintWriter printWriter)
-
printBorderLine
public void printBorderLine(PrintWriter printWriter)
-
-