could not find implicit value for evidence parameter of type org.apache.flink.api.common.typeinfo.TypeInformation[...]

jheyd picture jheyd · Jun 20, 2016 · Viewed 16.6k times · Source

I am trying to write some use cases for Apache Flink. One error I run into pretty often is

could not find implicit value for evidence parameter of type org.apache.flink.api.common.typeinfo.TypeInformation[SomeType]

My problem is that I cant really nail down when they happen and when they dont.

The most recent example of this would be the following

...
val largeJoinDataGen = new LargeJoinDataGen(dataSetSize, dataGen, hitRatio)
val see = StreamExecutionEnvironment.getExecutionEnvironment
val newStreamInput = see.addSource(largeJoinDataGen)
...

where LargeJoinDataGen extends GeneratorSource[(Int, String)] and GeneratorSource[T] extends SourceFunction[T], both defined in separate files.

When trying to build this I get

Error:(22, 39) could not find implicit value for evidence parameter of type org.apache.flink.api.common.typeinfo.TypeInformation[(Int, String)]
val newStreamInput = see.addSource(largeJoinDataGen)

1. Why is there an error in the given example?

2. What would be a general guideline when these errors happen and how to avoid them in the future?

P.S.: first scala project and first flink project so please be patient

Answer

dmreshet picture dmreshet · Jun 2, 2017

You may make an import instead of implicits

import org.apache.flink.streaming.api.scala._

It will also help.