local debug Scala

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

local debug Scala

yanlolo
Hi,

I want to debug my code in Scala IDE with local execution. I tested with the word count example, which created by

curl http://flink.apache.org/q/quickstart-scala.sh | bash


First: there is an error at “fromElement”,  “can't expand macros compiled by previous versions of Scala”.

Second: the console shows that “Error: Could not find or load main class org.myorg.quickstart.WordCount”

Scala version: 2.10.4

Scala eclipse version: 4.3.0



Thank you for your help.


Best regards,
lolo
_____________________________________________________________________
object WordCount {
  def main(args: Array[String]) {

    // set up the execution environment
    val env = ExecutionEnvironment.createLocalEnvironment()

    // get input data
    val text = env.fromElements("To be, or not to be,--that is the question:--",
      "Whether 'tis nobler in the mind to suffer", "The slings and arrows of outrageous fortune",
      "Or to take arms against a sea of troubles,")

    val counts = text.flatMap { _.toLowerCase.split("\\W+") }
      .map { (_, 1) }
      .groupBy(0)
      .sum(1)

    // execute and print result
    counts.print()

  }
}
____________________________________________________________________
Reply | Threaded
Open this post in threaded view
|

Re: local debug Scala

rmetzger0
This issue occurs when Flink has been build against another major scala release.
Did you build Flink yourself or download it from somewhere (maven central) ?