flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephan Ewen (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (FLINK-2788) Add type hint with TypeExtactor call on Hint Type
Date Tue, 01 Mar 2016 19:29:18 GMT

     [ https://issues.apache.org/jira/browse/FLINK-2788?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Stephan Ewen closed FLINK-2788.
-------------------------------

> Add type hint with TypeExtactor call on Hint Type
> -------------------------------------------------
>
>                 Key: FLINK-2788
>                 URL: https://issues.apache.org/jira/browse/FLINK-2788
>             Project: Flink
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 0.10.0
>            Reporter: Stephan Ewen
>            Assignee: Stephan Ewen
>             Fix For: 1.0.0, 1.1.0
>
>
> As per discussion with [~aljoscha]
> A very good and type safe way to supply type hints would be the following:
> Define a hint class that takes a generic parameter.
> {code}
> public abstract class TypeHint<T> {}
> {code}
> The hints would have the following method:
> {code}
> public DataSet<T> returns(TypeHint<T> hint);
> {code}
> It would be used like this:
> {code}
> DataSet<Sting> data = ...;
> data
>   .flatMap( (String str, Collector<Integer> out) -> out.collect(str.length())
)
>   .returns( new TypeHint<Integer>() {})
> {code}
> This would create an inline subclass of the hint, from which the type could be extracted.
The generics would ensure that it is typesafe.



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

Mime
View raw message