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

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

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

    https://github.com/apache/flink/pull/426#discussion_r26993897
  
    --- Diff: 
flink-scala/src/main/scala/org/apache/flink/api/scala/ExecutionEnvironment.scala
 ---
    @@ -247,16 +252,27 @@ class ExecutionEnvironment(javaEnv: JavaEnv) {
           inputFormat.enableQuotedStringParsing(quoteCharacter);
         }
     
    -    val classes: Array[Class[_]] = new Array[Class[_]](typeInfo.getArity)
    +    val classesBuf: ArrayBuffer[Class[_]] = new ArrayBuffer[Class[_]]
         for (i <- 0 until typeInfo.getArity) {
    -      classes(i) = typeInfo.getTypeAt(i).getTypeClass
    +      typeInfo match {
    +        case info: TupleTypeInfoBase[T] => classesBuf += 
info.getTypeAt(i).getTypeClass()
    +        case info: PojoTypeInfo[T] =>
    +          if (includedFields == null || includedFields.indexOf(i) != -1) {
    --- End diff --
    
    Just add all POJO fields without checking against includedFields. 
IncludedFields refer to the fields of the CSV file not to the fields of the 
POJO.
    The later check ensures that the number of read fields and the number of 
POJO/Tuple fields is equal.


> Add CsvReader for reading into POJOs.
> -------------------------------------
>
>                 Key: FLINK-1512
>                 URL: https://issues.apache.org/jira/browse/FLINK-1512
>             Project: Flink
>          Issue Type: New Feature
>          Components: Java API, Scala API
>            Reporter: Robert Metzger
>            Assignee: Chiwan Park
>            Priority: Minor
>              Labels: starter
>
> Currently, the {{CsvReader}} supports only TupleXX types. 
> It would be nice if users were also able to read into POJOs.



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

Reply via email to