twalthr commented on a change in pull request #17739:
URL: https://github.com/apache/flink/pull/17739#discussion_r748321138
##########
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:
No, currently the materialization happens on the server side. Given the
current code base I would stick to me comment above. After future refactorings
this view might change, because materialization might happen on the client side.
--
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]