[
https://issues.apache.org/jira/browse/FLINK-1062?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14119821#comment-14119821
]
Timo Walther commented on FLINK-1062:
-------------------------------------
How do we want to handle lambda functions which use local or member variables?
When using member variables, the lambda method is not static anymore. When
using local variables, the lambda methods get additional arguments e.g. in the
example below the functions signature will be lambda$2(String, Integer) instead
of lambda$2(Integer).
{code:java}
public static class MyClass {
private String s = "mystring";
public MapFunction<Integer, String> getMapFunction() {
return (i) -> s;
}
}
@Test
public void testLambdaWithMemberVariable() {
TypeInformation<?> ti = TypeExtractor.getMapReturnTypes(new
MyClass().getMapFunction(), TypeInfoParser.parse("Integer"));
}
@Test
public void testLambdaWithLocalVariable() {
String s = "mystring";
MapFunction<Integer, String> f = (i) -> s;
TypeInformation<?> ti = TypeExtractor.getMapReturnTypes(f,
TypeInfoParser.parse("Integer"));
}
{code}
> Type Extraction for Lambdas
> ---------------------------
>
> Key: FLINK-1062
> URL: https://issues.apache.org/jira/browse/FLINK-1062
> Project: Flink
> Issue Type: Improvement
> Components: Java API
> Affects Versions: 0.7-incubating
> Reporter: Stephan Ewen
> Assignee: Timo Walther
> Fix For: 0.7-incubating
>
>
> Lambdas currently work only for {{filter}} and {{reduce(a,b)}}, because
> Lambda type extraction is not in place right now.
> We need to extend the type extraction for lambdas to support the other
> functions.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)