Interface PrintStyle
- All Known Implementing Classes:
RawContentStyle,TableauStyle
@Internal
public interface PrintStyle
A
PrintStyle defines style and formatting to print a collection of RowData.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault max column width.static final StringValue used to printnull. -
Method Summary
Modifier and TypeMethodDescriptionvoidprint(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 Details
-
DEFAULT_MAX_COLUMN_WIDTH
static final int DEFAULT_MAX_COLUMN_WIDTHDefault max column width.- See Also:
-
NULL_VALUE
Value used to printnull.- See Also:
-
-
Method Details
-
print
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
Create a raw content print style, which only print the result content as raw form. column delimiter is ",", row delimiter is "\n".
-