Thanks very much. Forgive me for the simple question. I have found the doc in the latest code. My inner code is too old...
Jake <ft20...@qq.com> 于2021年10月26日周二 上午11:39写道: > > Hi, you can do like this: > > ```java > > val statementSet = tableEnv.createStatementSet() > val insertSqlBuffer = ListBuffer.empty[String] > > > val calciteParser = new CalciteParser(SqlUtil.getSqlParserConfig > (tableEnv.getConfig)) > sqlArr > .foreach(item => { > println(item) > val itemNode = calciteParser.parse(item) > > itemNode match { > case sqlSet: SqlSet => { > configuration.setString(sqlSet.getKeyString, sqlSet.getValueString) > } > case _: RichSqlInsert => insertSqlBuffer += item > case _ => { > println(item) > val itemResult = tableEnv.executeSql(item) > itemResult.print() > } > } > }) > > // execute batch inserts > if (insertSqlBuffer.size > 0) { > insertSqlBuffer.foreach(item => { > println("insert sql: " + item) > statementSet.addInsertSql(item) > }) > val explain = statementSet.explain() > println(explain) > statementSet.execute() > } > > > ``` > > > On Oct 26, 2021, at 11:27, 刘建刚 <liujiangangp...@gmail.com> wrote: > > I have multi batch SQL commands separated by semicolon(;). The SQL > commands need to be executed in order(In other cases, the SQL command may > share sources or sinks). I want to execute them in one job. When I > use tableEnv.executeSql(multiSQL), it will throw errors. How can I execute > them in one job? Thanks. > > >