You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Stephan Ewen (JIRA)" <ji...@apache.org> on 2015/08/02 19:36:04 UTC

[jira] [Commented] (FLINK-1665) Add optional annotations for POJOs to specify the order of fields

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

Stephan Ewen commented on FLINK-1665:
-------------------------------------

Hmm, not sure I am a bit fan of that. We are entering a weird space there, where we are hacking a schema model into the POJOs.

For CSV parsers, why not do it like this:
{code}
env.readCsv(file).pojoType(MyPojo.class, "id", "name", "favorite joke", "afraidOfSpiders")
{code}

For Table to POJO conversion (and vice versa), we have attribute names already, no need to impose an order...

> Add optional annotations for POJOs to specify the order of fields
> -----------------------------------------------------------------
>
>                 Key: FLINK-1665
>                 URL: https://issues.apache.org/jira/browse/FLINK-1665
>             Project: Flink
>          Issue Type: Improvement
>          Components: JobManager
>    Affects Versions: 0.8.0, 0.9
>            Reporter: Fabian Hueske
>
> The order of fields within a POJO is not well defined. 
> We could provide an optional annotation such as {{@Position(int)}} to enable the definition of field orders.
> The order of fields is relevant when mapping data to POJOs such as when generating POJOs from CSV input, converting POJOs to tuples (for example for the expression API), or when sorting POJOs (see FLINK-1664).



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