Interface PrintStyle
-
- All Known Implementing Classes:
RawContentStyle,TableauStyle
@Internal public interface PrintStyleAPrintStyledefines style and formatting to print a collection ofRowData.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_MAX_COLUMN_WIDTHDefault max column width.static StringNULL_VALUEValue used to printnull.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description voidprint(Iterator<RowData> it, PrintWriter printWriter)Displays the result.static RawContentStylerawContent(RowDataToStringConverter converter)Create a raw content print style, which only print the result content as raw form. column delimiter is ",", row delimiter is "\n".static TableauStyletableauWithDataInferredColumnWidths(ResolvedSchema schema, RowDataToStringConverter converter)LiketableauWithDataInferredColumnWidths(ResolvedSchema, RowDataToStringConverter, int, boolean, boolean), but using default values.static TableauStyletableauWithDataInferredColumnWidths(ResolvedSchema schema, RowDataToStringConverter converter, int maxColumnWidth, boolean printNullAsEmpty, boolean printRowKind)LiketableauWithTypeInferredColumnWidths(ResolvedSchema, RowDataToStringConverter, int, boolean, boolean), but uses the data to infer the column size.static TableauStyletableauWithTypeInferredColumnWidths(ResolvedSchema schema, RowDataToStringConverter converter, int maxColumnWidth, boolean printNullAsEmpty, boolean printRowKind)Create a newTableauStyleusing column widths computed from the type.
-
-
-
Field Detail
-
DEFAULT_MAX_COLUMN_WIDTH
static final int DEFAULT_MAX_COLUMN_WIDTH
Default max column width.- See Also:
- Constant Field Values
-
NULL_VALUE
static final String NULL_VALUE
Value used to printnull.- See Also:
- Constant Field Values
-
-
Method Detail
-
print
void print(Iterator<RowData> it, PrintWriter printWriter)
Displays the result.- Parameters:
it- The iterator for the data to printprintWriter- The writer to write to
-
tableauWithTypeInferredColumnWidths
static TableauStyle tableauWithTypeInferredColumnWidths(ResolvedSchema schema, RowDataToStringConverter converter, int maxColumnWidth, boolean printNullAsEmpty, boolean printRowKind)
Create a newTableauStyleusing column widths computed from the type.- Parameters:
schema- the schema of the data to printconverter- the converter to use to convert field values to stringmaxColumnWidth- Max column widthprintNullAsEmpty- A flag to indicate whether null should be printed as empty string more than<NULL>printRowKind- A flag to indicate whether print row kind info.
-
tableauWithDataInferredColumnWidths
static TableauStyle tableauWithDataInferredColumnWidths(ResolvedSchema schema, RowDataToStringConverter converter, int maxColumnWidth, boolean printNullAsEmpty, boolean printRowKind)
LiketableauWithTypeInferredColumnWidths(ResolvedSchema, RowDataToStringConverter, int, boolean, boolean), but uses the data to infer the column size.NOTE: please make sure the data to print is small enough to be stored in java heap memory.
-
tableauWithDataInferredColumnWidths
static TableauStyle tableauWithDataInferredColumnWidths(ResolvedSchema schema, RowDataToStringConverter converter)
LiketableauWithDataInferredColumnWidths(ResolvedSchema, RowDataToStringConverter, int, boolean, boolean), but using default values.NOTE: please make sure the data to print is small enough to be stored in java heap memory.
-
rawContent
static RawContentStyle rawContent(RowDataToStringConverter converter)
Create a raw content print style, which only print the result content as raw form. column delimiter is ",", row delimiter is "\n".
-
-