fsk119 commented on code in PR #21665:
URL: https://github.com/apache/flink/pull/21665#discussion_r1071869840


##########
flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/cli/CliView.java:
##########
@@ -361,25 +364,52 @@ protected int getHeight() {
         return height;
     }
 
+    public void clearTerminal() {
+        if (isPlainTerminal()) {
+            for (int i = 0; i < 200; i++) { // large number of empty lines
+                terminal.writer().println();
+            }
+        } else {
+            terminal.puts(InfoCmp.Capability.clear_screen);
+        }
+    }
+
+    protected boolean isPlainTerminal() {

Review Comment:
   You are right. I move it to `TerminalUtils`.



##########
flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/cli/CliTableauResultView.java:
##########
@@ -174,6 +180,9 @@ private void printStreamingResults(AtomicInteger 
receivedRowCount) {
                 case PAYLOAD:
                     List<RowData> changes = result.getPayload();
                     for (RowData change : changes) {
+                        if (Thread.currentThread().isInterrupted()) {

Review Comment:
   I think it's better we leave it here. Because the payload may contains many 
records. If we move it outside, we can only exit after all results are printed.



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