You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Timo Walther (JIRA)" <ji...@apache.org> on 2017/01/20 15:14:26 UTC

[jira] [Resolved] (FLINK-5549) TypeExtractor fails with RuntimeException, but should use GenericTypeInfo

     [ https://issues.apache.org/jira/browse/FLINK-5549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timo Walther resolved FLINK-5549.
---------------------------------
       Resolution: Fixed
    Fix Version/s: 1.2.0

Fixed in 1.3.0: 2703d339abafdd9f39bc35faa1eed718501f71a7
Fixed in 1.2.0: 0a24611a865ae6e321016672c951a8a632363bd4

> TypeExtractor fails with RuntimeException, but should use GenericTypeInfo
> -------------------------------------------------------------------------
>
>                 Key: FLINK-5549
>                 URL: https://issues.apache.org/jira/browse/FLINK-5549
>             Project: Flink
>          Issue Type: Bug
>          Components: Type Serialization System
>    Affects Versions: 1.2.0
>            Reporter: Robert Metzger
>            Assignee: Timo Walther
>             Fix For: 1.2.0
>
>
> This issue has been reported by a user on StackOverflow: http://stackoverflow.com/questions/41700568/runtimeexception-when-using-flinks-mapfunction-with-cassandra-insert-but-not
> {code}
> Exception in thread "main" java.lang.RuntimeException: The field private java.util.List com.datastax.driver.core.querybuilder.BuiltStatement.values is already contained in the hierarchy of the class com.datastax.driver.core.querybuilder.BuiltStatement.Please use unique field names through your classes hierarchy
>     at org.apache.flink.api.java.typeutils.TypeExtractor.getAllDeclaredFields(TypeExtractor.java:1762)
>     at org.apache.flink.api.java.typeutils.TypeExtractor.analyzePojo(TypeExtractor.java:1683)
>     at org.apache.flink.api.java.typeutils.TypeExtractor.privateGetForClass(TypeExtractor.java:1580)
>     at org.apache.flink.api.java.typeutils.TypeExtractor.privateGetForClass(TypeExtractor.java:1479)
>     at org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfoWithTypeHierarchy(TypeExtractor.java:737)
>     at org.apache.flink.api.java.typeutils.TypeExtractor.privateCreateTypeInfo(TypeExtractor.java:565)
>     at org.apache.flink.api.java.typeutils.TypeExtractor.getUnaryOperatorReturnType(TypeExtractor.java:366)
>     at org.apache.flink.api.java.typeutils.TypeExtractor.getUnaryOperatorReturnType(TypeExtractor.java:305)
>     at org.apache.flink.api.java.typeutils.TypeExtractor.getMapReturnTypes(TypeExtractor.java:120)
>     at org.apache.flink.streaming.api.datastream.DataStream.map(DataStream.java:506)
>     at se.hiq.bjornper.testenv.cassandra.SOCassandraQueryTest.main(SOCassandraQueryTest.java:51)
> {code}
> When Flink is trying to analyze the POJO, the {{getAllDeclaredFields}} method fails with a RuntimeException. When the user is using a different class that contains the POJO, it just uses the GenericTypeInfo which is able to serialize the type.
> I think we need to throw a InvalidTypesException in the {{getAllDeclaredFields}} method to fix the issue



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