You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "Sihua Zhou (JIRA)" <ji...@apache.org> on 2017/06/22 06:52:00 UTC

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

Sihua Zhou created FLINK-6980:
---------------------------------

             Summary: 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)