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

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

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

    https://github.com/apache/flink/pull/6037#discussion_r189885082
  
    --- Diff: 
flink-java/src/main/java/org/apache/flink/api/java/io/CsvReader.java ---
    @@ -316,14 +317,18 @@ public CsvReader ignoreInvalidLines(){
                Preconditions.checkNotNull(pojoType, "The POJO type class must 
not be null.");
                Preconditions.checkNotNull(pojoFields, "POJO fields must be 
specified (not null) if output type is a POJO.");
     
    -           @SuppressWarnings("unchecked")
    -           PojoTypeInfo<T> typeInfo = (PojoTypeInfo<T>) 
TypeExtractor.createTypeInfo(pojoType);
    +           final TypeInformation<T> ti = 
TypeExtractor.createTypeInfo(pojoType);
    +           if (!(ti instanceof PojoTypeInfo)) {
    +                   throw new IllegalArgumentException(
    +                           "The specified class is not a POJO. The type 
class must meet the POJO requirements. Found: " + ti);
    --- End diff --
    
    Yes, somewhere hidden in the documentation. I will fix this shortcoming as 
part of FLINK-8293 for 1.6.


> Flink should support Lombok POJO
> --------------------------------
>
>                 Key: FLINK-6909
>                 URL: https://issues.apache.org/jira/browse/FLINK-6909
>             Project: Flink
>          Issue Type: Wish
>          Components: Type Serialization System
>            Reporter: Md Kamaruzzaman
>            Assignee: Timo Walther
>            Priority: Minor
>
> Project lombok helps greatly to reduce boilerplate Java Code. 
> It seems that Flink does not accept a lombok POJO as a valid pojo. 
> e.g. Here is a POJO defined with lombok:
> @Getter
> @Setter
> @NoArgsConstructor
> public class SimplePojo
> Using this Pojo class to read from CSV file throws this exception:
> Exception in thread "main" java.lang.ClassCastException: 
> org.apache.flink.api.java.typeutils.GenericTypeInfo cannot be cast to 
> org.apache.flink.api.java.typeutils.PojoTypeInfo
> It would be great if flink supports lombok POJO.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to