[ https://issues.apache.org/jira/browse/FLINK-8858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16543529#comment-16543529 ]
ASF GitHub Bot commented on FLINK-8858: --------------------------------------- Github user pnowojski commented on a diff in the pull request: https://github.com/apache/flink/pull/6332#discussion_r202407651 --- Diff: flink-libraries/flink-sql-client/src/main/java/org/apache/flink/table/client/cli/CliClient.java --- @@ -173,55 +180,92 @@ public void open() { if (line == null || line.equals("")) { continue; } + parseAndCall(line); + } + } - final SqlCommandCall cmdCall = SqlCommandParser.parse(line); + /** + * Submits a SQL update statement and prints status information and/or errors on the terminal. + * + * @param statement SQL update statement + * @return flag to indicate if the submission was successful or not + */ + public boolean submitUpdate(String statement) { + terminal.writer().println(CliStrings.messageInfo(CliStrings.MESSAGE_WILL_EXECUTE).toAnsi()); + terminal.writer().println(new AttributedString(statement).toString()); + terminal.flush(); - if (cmdCall == null) { - terminal.writer().println(CliStrings.messageError(CliStrings.MESSAGE_UNKNOWN_SQL)); - continue; - } + final Optional<SqlCommandCall> parsedStatement = SqlCommandParser.parse(statement); --- End diff -- deduplicate parsing call and `if` check - there is already a bug here, either missing `flush` or unnecessary `flush` > Add support for INSERT INTO in SQL Client > ----------------------------------------- > > Key: FLINK-8858 > URL: https://issues.apache.org/jira/browse/FLINK-8858 > Project: Flink > Issue Type: Sub-task > Components: Table API & SQL > Affects Versions: 1.6.0 > Reporter: Renjie Liu > Assignee: Timo Walther > Priority: Major > Labels: pull-request-available > > The current design of SQL Client embedded mode doesn't support long running > queries. It would be useful for simple jobs that can be expressed in a single > sql statement if we can submit sql statements stored in files as long running > queries. -- This message was sent by Atlassian JIRA (v7.6.3#76005)