Re: Type extraction with generic variables

2014-11-11 Thread Vasiliki Kalavri
Thanks Stephan! Indeed, this worked fine :) Cheers, V. On 10 November 2014 12:26, Stephan Ewen wrote: > Hi Vasia! > > I think in your case, it would be even better to use "getMapReturnTypes( > MapFunction mapInterface, TypeInformation inType)" > > That way you can pass the function that you wr

Re: Type extraction with generic variables

2014-11-10 Thread Stephan Ewen
Hi Vasia! I think in your case, it would be even better to use "getMapReturnTypes( MapFunction mapInterface, TypeInformation inType)" That way you can pass the function that you wrap (the one that maps the vertex values) and get its produced type. But I think the example shows that we need much

Re: Type extraction with generic variables

2014-11-10 Thread Timo Walther
Hey, the TypeExtractor.getForClass() is only intended for primitive types, if you want to extract all kinds of types you should use TypeExtractor.createTypeInfo(Type t) (a class is also a type). However, I think it would be better if your method takes TypeInformation as an argument instead of

Re: Type extraction with generic variables

2014-11-08 Thread Vasiliki Kalavri
Hello again, I tried out your suggestion and made a variation of the mapVertices method, which takes the class of the new value as an argument. In order to extract the type from the class, I use the TypeExtractor.getForClass() method. Is this what you had in mind? When testing, this seems to work

Re: Type extraction with generic variables

2014-10-30 Thread Vasiliki Kalavri
Hi Timo, thank you for the explanation! I guess I will try implementing ResultTypeQueryable then :) Cheers, Vasia. On 30 October 2014 13:01, Timo Walther wrote: > Hi Vasiliki, > > your error is a very common problem we have together with types. The > problem is that Java does type erasure, whi

Re: Type extraction with generic variables

2014-10-30 Thread Timo Walther
Hi Vasiliki, your error is a very common problem we have together with types. The problem is that Java does type erasure, which means that return vertices.map(new ApplyMapperToVertex(mapper)); becomes return vertices.map(new ApplyMapperToVertex(mapper)); Therefore we don't have the types. B

Type extraction with generic variables

2014-10-30 Thread Vasiliki Kalavri
Hi all, one of the operations we want to implement for the flink graph api is mapVertices, i.e. applying a mapper to the vertices of the graph. The current implementation assumes that the vertex value type remains the same: https://github.com/project-flink/flink-graph/blob/master/src/main/java/fli