twalthr commented on a change in pull request #17739:
URL: https://github.com/apache/flink/pull/17739#discussion_r748323594
##########
File path:
flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/cli/CliTableauResultView.java
##########
@@ -126,34 +122,29 @@ private void checkAndCleanUpQuery(boolean cleanUpQuery) {
private void printBatchResults(AtomicInteger receivedRowCount) {
final List<RowData> resultRows = waitBatchResults();
receivedRowCount.addAndGet(resultRows.size());
- PrintUtils.printAsTableauForm(
- resultDescriptor.getResultSchema(),
- resultRows.iterator(),
- terminal.writer(),
- sessionTimeZone);
+ TableauStyle style =
+ PrintStyle.tableauWithDataInferredColumnWidths(
+ resultDescriptor.getResultSchema(),
+ resultDescriptor.getRowDataStringConverter(),
+ PrintStyle.DEFAULT_MAX_COLUMN_WIDTH,
+ false,
+ false);
+ style.print(resultRows.iterator(), terminal.writer());
}
private void printStreamingResults(AtomicInteger receivedRowCount) {
- List<Column> columns = resultDescriptor.getResultSchema().getColumns();
- final String[] fieldNames =
- Stream.concat(
- Stream.of(PrintUtils.ROW_KIND_COLUMN),
- columns.stream().map(Column::getName))
- .toArray(String[]::new);
-
- final int[] colWidths =
- PrintUtils.columnWidthsByType(
- columns,
+ TableauStyle style =
+ PrintStyle.tableauWithTypeInferredColumnWidths(
+ resultDescriptor.getResultSchema(),
+ resultDescriptor.getRowDataStringConverter(),
Review comment:
I'm fine if you ignore my comment. But the architecture will need some
rework soon.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]