[ 
https://issues.apache.org/jira/browse/FLINK-2336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14620345#comment-14620345
 ] 

William Saar commented on FLINK-2336:
-------------------------------------

When replacing the lambda with a MapFunction instance, one gets the following 
clearer error message

Caused by: org.apache.flink.api.common.functions.InvalidTypesException: Type of 
TypeVariable 'O' in 'class ...' 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).
        at 
org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfoWithTypeHierarchy(TypeExtractor.java:473)
        at 
org.apache.flink.api.java.typeutils.TypeExtractor.privateCreateTypeInfo(TypeExtractor.java:361)

> ArrayIndexOufOBoundsException in TypeExtractor when mapping
> -----------------------------------------------------------
>
>                 Key: FLINK-2336
>                 URL: https://issues.apache.org/jira/browse/FLINK-2336
>             Project: Flink
>          Issue Type: Bug
>    Affects Versions: master
>            Reporter: William Saar
>
> The line that causes this is
> DataStream<O> outputStream = insideIterationStream.filter(outputFilter).map(m 
> -> m.outputMessage);
> Problem occurs both when compiled using Javac and Eclipse's JDT compiler (in 
> an environment where simple lambda type tests work)
> Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1
>       at java.util.ArrayList.elementData(Unknown Source)
>       at java.util.ArrayList.get(Unknown Source)
>       at 
> org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfoFromInputs(TypeExtractor.java:553)
>       at 
> org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfoWithTypeHierarchy(TypeExtractor.java:468)
>       at 
> org.apache.flink.api.java.typeutils.TypeExtractor.privateCreateTypeInfo(TypeExtractor.java:370)
>       at 
> org.apache.flink.api.java.typeutils.TypeExtractor.getUnaryOperatorReturnType(TypeExtractor.java:254)
>       at 
> org.apache.flink.api.java.typeutils.TypeExtractor.getMapReturnTypes(TypeExtractor.java:91)
>       at 
> org.apache.flink.streaming.api.datastream.DataStream.map(DataStream.java:605)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to