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

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

Github user StephanEwen commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1141#discussion_r40327817
  
    --- Diff: 
flink-staging/flink-language-binding/flink-language-binding-generic/src/main/java/org/apache/flink/languagebinding/api/java/common/PlanBinder.java
 ---
    @@ -256,7 +258,20 @@ protected OperationInfo createOperationInfo(Operation 
operationIdentifier) throw
        protected abstract INFO createOperationInfo(AbstractOperation 
operationIdentifier) throws IOException;
     
        private void createCsvSource(OperationInfo info) throws IOException {
    -           sets.put(info.setID, env.createInput(new CsvInputFormat(new 
Path(info.path), info.lineDelimiter, info.fieldDelimiter, info.types), 
info.types).name("CsvSource"));
    +           if (!(info.types instanceof CompositeType)) {
    +                   throw new RuntimeException("The output type of a csv 
source has to be a tuple or a " +
    +                           "pojo type. The derived type is " + info);
    +           }
    +
    +           sets.put(
    --- End diff --
    
    Style comment: I think that is a bit much line breaking for the common Java 
style. I think the common Java styles don't do that quite as heavy as the Scala 
style.


> CsvInputFormat cannot find the field of derived POJO class
> ----------------------------------------------------------
>
>                 Key: FLINK-2690
>                 URL: https://issues.apache.org/jira/browse/FLINK-2690
>             Project: Flink
>          Issue Type: Bug
>          Components: Java API, Scala API
>    Affects Versions: 0.10
>            Reporter: Chiwan Park
>            Assignee: Till Rohrmann
>
> A user reports {{CsvInputFormat}} cannot find the field of derived POJO 
> class. 
> (http://mail-archives.apache.org/mod_mbox/flink-user/201509.mbox/%3ccaj54yvi6cbldn7cypey+xe8a5a_j1-6tnx1wm1eb63gvnqd...@mail.gmail.com%3e)
> The reason of the bug is that {{CsvInputFormat}} uses {{getDeclaredField}} 
> method without scanning base classes to find the field. When 
> {{CsvInputFormat}} was wrote, {{TypeInformation}} cannot be serialized. So we 
> needed to initialize {{TypeInformation}} in {{open}} method manually. Some 
> mistakes in initializing cause this bug.
> After FLINK-2637 is merged, we can serialize {{TypeInformation}} and don't 
> need to create field objects in {{CsvInputFormat}}.



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

Reply via email to