Hi,

Flink uses the signature of the class to determine the return types of a function ("class MyClass implements MapFunction<IN, OUT>"). You always have to keep in mind that every generic in a "new XXXX<String,NullValue>()" gets erasured by Java to "new XXXX()". So variable K has to be determined by the input type (which is always known).

It would be great if you could also share " TGraphAlgorithm" and all classes till Function in the hierarchy. According to your comment in " SingleSourceShortestTemporalPathEAT3" K is in the input type, so this could be a bug. Have you tried the latest snapshot release? There were some type inference improvements lately.

Regards,
Timo


Am 17/11/16 um 13:31 schrieb otherwise777:
I get this error:

*Exception in thread "main"
org.apache.flink.api.common.functions.InvalidTypesException: Type of
TypeVariable 'K' in 'class
Tgraphs.SingleSourceShortestTemporalPathEAT3$InitVerticesMapper' could not
be determined. This is most likely a type erasure problem. The type
extraction currently supports types with generic variables only in cases
where all variables in the return type can be deduced from the input
type(s).*

When i run my function:

*tempgraphdoubles.run(new
SingleSourceShortestTemporalPathEAT3<String,NullValue>("A",maxIterations)).print();*

The function is here:  http://paste.thezomg.com/19924/93864391/
<http://paste.thezomg.com/19924/93864391/>

I've narrowed it down to the Tuple2<K,Double> on line 44, apperently it
doesn't like the K being there in a Tuple2<>

I couldn't find out why though, and how would i make a workaround for this
when i a want to use this scenario?



--
View this message in context: 
http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Type-of-TypeVariable-K-in-class-could-not-be-determined-tp10173.html
Sent from the Apache Flink User Mailing List archive. mailing list archive at 
Nabble.com.

Reply via email to