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

Michael Gendelman commented on FLINK-18696:
-------------------------------------------

[~rmetzger] Sorry if I'm way off here. Just starting to explore this.

Seems like Flink assumes that Pojo must have getter, setter and default 
constructor but record don't have setter and default constructor. 

I was trying to do this:
{code:java}

TypeInformation<Simple> recordType = TypeExtractor.getForClass(Simple.class);

{code}
And failed at _analyzePojo (_isValidPojoField and 
clazz.getDeclaredConstructor()).

> Java 14 Records are not recognized as POJOs
> -------------------------------------------
>
>                 Key: FLINK-18696
>                 URL: https://issues.apache.org/jira/browse/FLINK-18696
>             Project: Flink
>          Issue Type: Improvement
>          Components: API / Type Serialization System
>            Reporter: Robert Metzger
>            Priority: Major
>              Labels: starter
>
> Having a record (https://openjdk.java.net/jeps/359) such as:
> {code}
> public record Simple(int id, String name) { }
> {code}
> Leads to this log message: "class de.robertmetzger.TableApiSql$Simple does 
> not contain a setter for field id"
> I believe the PojoSerializer should be able to use records.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to