slinkydeveloper commented on a change in pull request #17739:
URL: https://github.com/apache/flink/pull/17739#discussion_r748337135



##########
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 would personally prefer to ignore this comment now, since this change 
is already pretty big and I feel modifying the way views works is even a bigger 
change.
   
   I'm ok with reworking the architecture, but then we need to make sure 
everything passing through `Executor` needs to be some kind of primitive type, 
that is as you sad we probably need to rework `executeOperation` as well, as 
the other types.




-- 
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]


Reply via email to