Hi,

I have written simple wordcount program in scala. When I execute the
program, I'm getting below exception.

Please let me know how to fix this issue. I'm using Flink 0.9.0 version

*Below is the program :-*

    val env = ExecutionEnvironment.getExecutionEnvironment
    // get input data
    val text = env readTextFile("/Users/hadoop2/Data/word.txt")
    val counts = text flatMap(l=>l split(" ")) map(word=>(word,1))
groupBy(0) sum(1)
    // emit result
    counts print
    env.execute("TEST")

*Exception :-*

Exception in thread "main" java.lang.RuntimeException: No new data sinks
have been defined since the last execution. The last execution refers to
the latest call to 'execute()', 'count()', 'collect()', or 'print()'.
    at
org.apache.flink.api.java.ExecutionEnvironment.createProgramPlan(ExecutionEnvironment.java:910)
    at
org.apache.flink.api.java.ExecutionEnvironment.createProgramPlan(ExecutionEnvironment.java:893)
    at
org.apache.flink.api.java.LocalEnvironment.execute(LocalEnvironment.java:50)
    at
org.apache.flink.api.scala.ExecutionEnvironment.execute(ExecutionEnvironment.scala:590)
    at WordCount$.main(WordCount.scala:17)
    at WordCount.main(WordCount.scala)

Regards,
Rajesh

Reply via email to