zjffdu commented on code in PR #4443: URL: https://github.com/apache/zeppelin/pull/4443#discussion_r945299770
########## livy/src/main/java/org/apache/zeppelin/livy/LivySparkSQLInterpreter.java: ########## @@ -114,6 +110,40 @@ public void open() throws InterpreterException { @Override public InterpreterResult interpret(String line, InterpreterContext context) { + String appInfoHtml = ""; + List<String> sqlQueries = sqlSplitter.splitSql(line); + for (String query:sqlQueries) { + try { + InterpreterResult res = interpret_(query, context); + for(InterpreterResultMessage msg: res.message()){ + if (this.displayAppInfo && msg.getData().startsWith("<hr/>Spark Application Id: ")){ + appInfoHtml = msg.toString(); + continue; + } + context.out.write(msg.toString()); + context.out.write("\n"); + context.out.flush(); + } + }catch (Exception e){ + LOGGER.error(e.toString()); + e.printStackTrace(); + } + } + + if(this.displayAppInfo){ + try { + context.out.write(appInfoHtml); + context.out.flush(); + }catch (Exception e){ + LOGGER.error(e.getMessage()); + e.printStackTrace(); + } + } + + return new InterpreterResult(InterpreterResult.Code.SUCCESS); + } + + public InterpreterResult interpret_(String line, InterpreterContext context) { Review Comment: How about `interpret_` -> `interpretSql` ? ########## livy/src/main/java/org/apache/zeppelin/livy/LivySparkSQLInterpreter.java: ########## @@ -114,6 +110,40 @@ public void open() throws InterpreterException { @Override public InterpreterResult interpret(String line, InterpreterContext context) { Review Comment: How about line -> text ? -- 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: dev-unsubscr...@zeppelin.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org