I am writing a simple word count flink job but I keep getting this error:
could not find implicit value for evidence parameter of type org.apache.flink.api.common.typeinfo.TypeInformation[String]
[error] .flatMap{_.toLowerCase.split("\\W+") filter {_.nonEmpty}}
I searched the net but could not get any comprehensible answer.
Here is my code:
object Job {
def main(args: Array[String]) {
// set up the execution environment
val env = StreamExecutionEnvironment.getExecutionEnvironment
val dataStream = env.readTextFile("file:///home/plivo/code/flink/scala/flinkstream/test/")
val count = dataStream
.flatMap{_.toLowerCase.split("\\W+") filter {_.nonEmpty}}
.map{ (_,1) }
.groupBy(0)
.sum(1)
dataStream.print()
env.execute("Flink Scala API Skeleton")
}
}
import flink.api.scala._
because the streaming as well as the batch scala package object importcreateTypeInformation
. So these imports might clash. – Till Rohrmann