You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/05/14 11:22:00 UTC

[jira] [Commented] (FLINK-1398) A new DataSet function: extractElementFromTuple

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

ASF GitHub Bot commented on FLINK-1398:
---------------------------------------

Github user FelixNeutatz commented on the pull request:

    https://github.com/apache/flink/pull/308#issuecomment-101981739
  
    So, what is the final decision here?
    
    >  this seems like a lot of code for something that can be achieved using a simple mapper
    --> that is exactly the reason why I would want this functionality - it is too much code for a simple thing :)


> A new DataSet function: extractElementFromTuple
> -----------------------------------------------
>
>                 Key: FLINK-1398
>                 URL: https://issues.apache.org/jira/browse/FLINK-1398
>             Project: Flink
>          Issue Type: Wish
>            Reporter: Felix Neutatz
>            Assignee: Felix Neutatz
>            Priority: Minor
>
> This is the use case:
> {code:xml}
>         DataSet<Tuple2<Integer, Double>> data =  env.fromElements(new Tuple2<Integer, Double>(1,2.0));
>         
>         data.map(new ElementFromTuple());
>         
>     }
>     public static final class ElementFromTuple implements MapFunction<Tuple2<Integer, Double>, Double> {
>         @Override
>         public Double map(Tuple2<Integer, Double> value) {
>             return value.f1;
>         }
>     }
> {code}
> It would be awesome if we had something like this:
> {code:xml}
>     data.extractElement(1);
> {code}
> This means that we implement a function for DataSet which extracts a certain element from a given Tuple.



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