slinkydeveloper commented on a change in pull request #17739:
URL: https://github.com/apache/flink/pull/17739#discussion_r748309431
##########
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:
My understanding from last time we talked about this is that we can't
easily convert the CLI classes to handle directly `String`s instead of
`RowData`, because we perform the materialization here.
--
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]