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 2014/08/14 20:54:12 UTC

[jira] [Commented] (FLINK-933) Add an input format to read primitive types directly (not through tuples)

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

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

Github user StephanEwen commented on the pull request:

    https://github.com/apache/incubator-flink/pull/47#issuecomment-52226058
  
    Instread of having a separate format to maintain, you could simply read a tuple-1 and then unwrap the type. That way you would only need the function in DataSet
    
    ```
    public <X> DataSet<X> readBasicTypeFile(String filePath, Class<X> typeClass) {
        return readCsv(filePath).types(typeClass).map(new Unwrapper());
    }
    ```
    
    You would loose control over the data source though, because the returned type is the map operator.


> Add an input format to read primitive types directly (not through tuples)
> -------------------------------------------------------------------------
>
>                 Key: FLINK-933
>                 URL: https://issues.apache.org/jira/browse/FLINK-933
>             Project: Flink
>          Issue Type: Bug
>            Reporter: Stephan Ewen
>            Assignee: Mingliang Qi
>            Priority: Minor
>              Labels: easyfix, features, starter
>
> Right now, reading primitive types goes either through custom formats (work intensive), or through CSV inputs. The latter return tuples.
> To read a sequence of primitives, you need to go though Tuple1, which is clumsy.
> I would suggest to add an input format to read primitive types line wise (or otherwise delimited), and also add a method to the environment for that.



--
This message was sent by Atlassian JIRA
(v6.2#6252)