I’m trying to run a very simple flink app - run fl...
# troubleshooting
t
I’m trying to run a very simple flink app - run flink locally (without a local cluster, just from the code with
createLocalEnvironmentWithWebUI
), read from kafka topic, and print.
Copy code
val env = StreamExecutionEnvironment.createLocalEnvironmentWithWebUI()
    val tableEnv = StreamTableEnvironment.create(env)

    val ddl =
      """CREATE TABLE invalid_events ( ... ) WITH ( 'connector' = 'kafka' .... ) """

    val sql1 = """CREATE TABLE print_table ( ... ) WITH ('connector' = 'print');"""

    val sql2 = """INSERT INTO print_table SELECT * FROM invalid_events;"""

    tableEnv.executeSql(ddl)

    tableEnv.executeSql(sql1)
    tableEnv.executeSql(sql2)
    
    env.execute("my job")
I’m getting:
Copy code
Exception in thread "main" java.lang.IllegalStateException: No operators defined in streaming topology. Cannot execute.
What am I missing?
h
no need for this: env.execute("my job").
👍 1
t
@hui ch Without the env.execute the program exits with exit code 0, (without even creating the local cluster)
h
i have no problem running it locally. make sure your configuration is correct:`WITH ( 'connector' = 'kafka' .... )`
and this function:
createLocalEnvironmentWithWebUI(Configuration conf)