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



##########
File path: 
flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/cli/CliClient.java
##########
@@ -264,25 +270,43 @@ public boolean executeInitialization(String content) {
      * terminal.
      */
     private void executeInteractive() {
-        isRunning = true;
-        LineReader lineReader = createLineReader(terminal);
-
         // make space from previous output and test the writer
         terminal.writer().println();
         terminal.writer().flush();
 
         // print welcome
         terminal.writer().append(CliStrings.MESSAGE_WELCOME);
 
+        LineReader lineReader = createLineReader(terminal);
+        getAndExecuteStatements(lineReader, 
ExecutionMode.INTERACTIVE_EXECUTION);
+    }
+
+    private boolean getAndExecuteStatements(LineReader lineReader, 
ExecutionMode mode) {
         // begin reading loop
+        boolean exitOnFailure = 
!mode.equals(ExecutionMode.INTERACTIVE_EXECUTION);
+        isRunning = true;
         while (isRunning) {
             // make some space to previous command
             terminal.writer().append("\n");
             terminal.flush();
 
-            String line;
+            Optional<Operation> parsedOperation = Optional.empty();
             try {
-                line = lineReader.readLine(prompt, null, inputTransformer, 
null);
+                String line = lineReader.readLine(prompt, null, 
inputTransformer, null);
+                if (line.trim().isEmpty()) {
+                    continue;
+                }
+                parsedOperation = parser.getParsedOperation();

Review comment:
       I see, then let's keep it as it is. Perhaps just comment the method 
`getParsedOperation` and a bit the code here to explain the relationship and 
the state sharing between these two objects




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