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

2017-07-19 Thread Timo Walther (JIRA)

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

Timo Walther commented on FLINK-6980:
-

[~sihuazhou] are you using Flink's Table & SQL API for your Stream SQL 
framework? Yes, I think you should create your own type to be on the save side.

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


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

2017-07-18 Thread Sihua Zhou (JIRA)

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

Sihua Zhou commented on FLINK-6980:
---

[~twalthr] Actually, we are building a stream sql framework base on flink. We 
need a class to present the row of sql result and also act like the `LongValue` 
in flink, so we create a class which extends `Row` and implements `Value`. 
Although , this issue only cause the problem in our test case, i think your 
suggestion is good, maybe we should wrap a field of type `Row` and implements 
`Value` instead of extending it. In this way, even you make `Row` final won't 
have any effect on us.

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


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

2017-07-18 Thread Timo Walther (JIRA)

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

Timo Walther commented on FLINK-6980:
-

[~sihuazhou] The problem is that we have TypeInformation for both {{Row}} and 
{{Value}}. FLINK-5358 changed the precedence here. I think you should not mix 
value types and row types. Maybe we should make Row final. What do you want to 
achieve?

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


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

2017-07-17 Thread Stephan Ewen (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-6980?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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 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)