You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Stephan Ewen (JIRA)" <ji...@apache.org> on 2017/07/17 18:48:00 UTC

[jira] [Commented] (FLINK-6980) TypeExtractor.getForObject can't get typeinfo correctly.

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

Stephan Ewen commented on FLINK-6980:
-------------------------------------

Thanks for reporting this.

[~twalthr] This would be your turf - do you have a chance to look at this? Or give [~sihuazhou] a pointer about how to create a patch for this?

> TypeExtractor.getForObject can't get typeinfo correctly.
> --------------------------------------------------------
>
>                 Key: FLINK-6980
>                 URL: https://issues.apache.org/jira/browse/FLINK-6980
>             Project: Flink
>          Issue Type: Bug
>          Components: DataStream API
>    Affects Versions: 1.3.0
>            Reporter: Sihua Zhou
>            Priority: Minor
>
> Here is my class define:
> _class MyRecord extends Row implements Retracting, Value {}_
> When i use it like below, it just throw type cast error: java.lang.ClassCastException: org.apache.flink.types.Row cannot be cast to org.apache.flink.types.Value
> MyRecord[] recordList = new MyRecord[6];
> DataStream<MyRecord> dataStream = env.fromElements(recordList);
> //MyFilter 's input arg type is MyRecord.
> dataStream.flatMap(new MyFilter()).returns(MyRecord.class).print();
> I found this is becuase of the TypeExtractor.getForObject called in env.fromElements() can't get the 
> element's type corrently and TypeExtractor.getForObject work corrently in flink 1.2.0. 
> I know this problem can be solved by use env.fromElement(MyRecord.class, recordList) instead, i just want to know whether this is a bug or not? Why it can be work correctly in 1.2.0 and can't in 1.3.0?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)