https://stackoverflow.com/questions/48151881/how-to-run-apache-flink-streaming-job-continuously-on-flink-server
On Thu, Feb 20, 2020 at 3:14 AM Chesnay Schepler <ches...@apache.org> wrote: > Can you show us where you found the suggestion to use iterate()? > > On 20/02/2020 02:08, Fanbin Bu wrote: > > Hi, > > > > My app creates the source from JDBC inputformat and running some sql > > and print out. But the source terminates itself after the query is > > done. Is there anyway to keep the source running? > > samle code: > > val env = StreamExecutionEnvironment.getExecutionEnvironment > > val settings = EnvironmentSettings.newInstance() > > .useBlinkPlanner() > > .inStreamingMode() > > .build() > > val tEnv = StreamTableEnvironment.create(env, settings) > > val inputFormat > > = JDBCInputFormat.buildJDBCInputFormat.setQuery("select * from > > table")... .finish() > > val source = env.createInput(inputFormat) > > tEnv.registerTableSource(source) > > val queryResult = tEnv.sqlQuery("select * from awesomeSource") > > queryResult.insertInto(mySink) > > > > > > I searched around and its suggested to use .iterate(). can somebody > > give more examples on how to use it in this case? > > > > Thanks, > > Fanbin > > >