Github user twalthr commented on a diff in the pull request: https://github.com/apache/flink/pull/6332#discussion_r202507463 --- Diff: flink-libraries/flink-sql-client/src/main/java/org/apache/flink/table/client/SqlClient.java --- @@ -97,14 +97,34 @@ private void start() { // add shutdown hook Runtime.getRuntime().addShutdownHook(new EmbeddedShutdownThread(context, executor)); - // start CLI - final CliClient cli = new CliClient(context, executor); - cli.open(); + // do the actual work + openCli(context, executor); } else { throw new SqlClientException("Gateway mode is not supported yet."); } } + /** + * Opens the CLI client for executing SQL statements. + * + * @param context session context + * @param executor executor + */ + private void openCli(SessionContext context, Executor executor) { + final CliClient cli = new CliClient(context, executor); + // interactive CLI mode + if (options.getUpdateStatement() == null) { + cli.open(); + } + // execute single update statement + else { + final boolean success = cli.submitUpdate(options.getUpdateStatement()); --- End diff -- No, this would block the process for unbounded queries and require a (fault-tolerant) monitoring in the SQL Client which is not intended. We just block until the statement has been submitted to the cluster.
---