Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-9162

Scala REPL hanging when running example

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 1.5.0
    • None
    • Scala Shell
    • None

    Description

      ➜  build-target git:(master) bin/start-cluster.sh
      Starting cluster.
      Starting standalonesession daemon on host localhost.
      Starting taskexecutor daemon on host localhost.
      ➜  build-target git:(master) bin/start-scala-shell.sh local
      Starting Flink Shell:
      log4j:WARN No appenders could be found for logger (org.apache.flink.configuration.GlobalConfiguration).
      log4j:WARN Please initialize the log4j system properly.
      log4j:WARN See [http://logging.apache.org/log4j/1.2/faq.html#noconfig] for more info.
      
      Starting local Flink cluster (host: localhost, port: 49592). 
      
      Connecting to Flink cluster (host: localhost, port: 49592).
      
      ...
      
      scala> val dataStream = senv.fromElements(1, 2, 3, 4)
      dataStream: org.apache.flink.streaming.api.scala.DataStream[Int] = org.apache.flink.streaming.api.scala.DataStream@6b576ff8
      
      scala> dataStream.countWindowAll(2).sum(0).print()
      res0: org.apache.flink.streaming.api.datastream.DataStreamSink[Int] = org.apache.flink.streaming.api.datastream.DataStreamSink@304e1e4e
      
      scala> val text = benv.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,")
      text: org.apache.flink.api.scala.DataSet[String] = org.apache.flink.api.scala.DataSet@1237aa73
      
      scala> val counts = text .flatMap { _.toLowerCase.split("\\W+") } .map { (_, 1) }.groupBy(0).sum(1)
      counts: org.apache.flink.api.scala.AggregateDataSet[(String, Int)] = org.apache.flink.api.scala.AggregateDataSet@7dbf92aa
       
      scala> counts.print()
      <Hanging>

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              tison Zili Chen
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: