Re: ype of TypeVariable could not be determined

2016-03-09 Thread Timo Walther
I think your problem is that you declared "TupleEvent2" as a 
TypeVariable in your code but I think you want to use a class that you 
defined, right?


If so this is the correct declaration:

MySourceFunction implements SourceFunction

On 09.03.2016 09:28, Wang Yangjun wrote:

Hello,

I think in this case you could just implement your 
“MySourceFunction” both SourceFunction and 
ResultTypeQueryable interfaces.


MySourceFunction implements SourceFunction, 
ResultTypeQueryable< TupleEvent2 >

{
…
}

Best,
Jun

From: Radu Tudoran <radu.tudo...@huawei.com 
<mailto:radu.tudo...@huawei.com>>
Reply-To: "user@flink.apache.org <mailto:user@flink.apache.org>" 
<user@flink.apache.org <mailto:user@flink.apache.org>>

Date: Wednesday 9 March 2016 at 09:41
To: "user@flink.apache.org <mailto:user@flink.apache.org>" 
<user@flink.apache.org <mailto:user@flink.apache.org>>

Subject: RE: ype of TypeVariable could not be determined

Hi,

The issue is that this problem appears when I want to create a stream 
source.


|StreamExecutionEnvironment.addSource(new MySourceFunction())|

…

Where the stream source class is

MySourceFunction implements SourceFunction

{

…

}

In such a case I am not sure how I can pass the outertype  nor how I 
can pass it using the “.returns()” method as Timo suggested


Dr. Radu Tudoran

Research Engineer - Big Data Expert

IT R Division

cid:image007.jpg@01CD52EB.AD060EE0

HUAWEI TECHNOLOGIES Duesseldorf GmbH

European Research Center

Riesstrasse 25, 80992 München

E-mail: _radu.tudo...@huawei.com <mailto:radu.tudo...@huawei.com>_

Mobile: +49 15209084330

Telephone: +49 891588344173

HUAWEI TECHNOLOGIES Duesseldorf GmbH
Hansaallee 205, 40549 Düsseldorf, Germany, www.huawei.com 
<http://www.huawei.com/>

Registered Office: Düsseldorf, Register Court Düsseldorf, HRB 56063,
Managing Director: Bo PENG, Wanzhou MENG, Lifang CHEN
Sitz der Gesellschaft: Düsseldorf, Amtsgericht Düsseldorf, HRB 56063,
Geschäftsführer: Bo PENG, Wanzhou MENG, Lifang CHEN

This e-mail and its attachments contain confidential information from 
HUAWEI, which is intended only for the person or entity whose address 
is listed above. Any use of the information contained herein in any 
way (including, but not limited to, total or partial disclosure, 
reproduction, or dissemination) by persons other than the intended 
recipient(s) is prohibited. If you receive this e-mail in error, 
please notify the sender by phone or email immediately and delete it!


*From:*Wang Yangjun [mailto:yangjun.w...@aalto.fi]
*Sent:* Tuesday, March 08, 2016 7:15 PM
*To:* user@flink.apache.org <mailto:user@flink.apache.org>
*Subject:* Re: ype of TypeVariable could not be determined

Hi Radu,

I met this issue also. The reason is outTypeInfo couldn't be created 
base on generic type when a transform applied.


public  SingleOutputStreamOperator<R, ?> transform(String 
operatorName, TypeInformation outTypeInfo, 
OneInputStreamOperator<T, R> operator)


The solution would be passed Calss to your UDF and create 
TypeInfomation by yourself.


Best,

Jun

*From: *Radu Tudoran <radu.tudo...@huawei.com 
<mailto:radu.tudo...@huawei.com>>
*Reply-To: *"user@flink.apache.org <mailto:user@flink.apache.org>" 
<user@flink.apache.org <mailto:user@flink.apache.org>>

*Date: *Tuesday 8 March 2016 at 19:57
*To: *"user@flink.apache.org <mailto:user@flink.apache.org>" 
<user@flink.apache.org <mailto:user@flink.apache.org>>

*Subject: *ype of TypeVariable could not be determined

Hi,

I am trying to create a custom stream source. I first build this with 
generic and I run into problems regarding type extraction. I tried to 
put concrete types but run into the same issue (see errors below). Can 
anyone provide a solution to solve this issue.


Caused by: 
_org.apache.flink.api.common.functions.InvalidTypesException_: Type of 
TypeVariable 'IN' in 'class test.MySourceFunction' could not be 
determined. This is most likely a type erasure problem. The type 
extraction currently supports types with generic variables only in 
cases where all variables in the return type can be deduced from the 
input type(s).


   at 
org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfoWithTypeHierarchy(_TypeExtractor.java:498_)


   at 
org.apache.flink.api.java.typeutils.TypeExtractor.privateCreateTypeInfo(_TypeExtractor.java:380_)


   at 
org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfo(_TypeExtractor.java:346_)


   at 
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.addSource(_StreamExecutionEnvironment.java:1152_)


   at 
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.addSource(_StreamExecutionEnvironment.java:1107_)


   at 
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.ad

Re: ype of TypeVariable could not be determined

2016-03-09 Thread Wang Yangjun
Hello,

I think in this case you could just implement your 
“MySourceFunction” both SourceFunction and ResultTypeQueryable 
interfaces.

MySourceFunction implements SourceFunction, 
ResultTypeQueryable< TupleEvent2 >
{
…
}

Best,
Jun

From: Radu Tudoran <radu.tudo...@huawei.com<mailto:radu.tudo...@huawei.com>>
Reply-To: "user@flink.apache.org<mailto:user@flink.apache.org>" 
<user@flink.apache.org<mailto:user@flink.apache.org>>
Date: Wednesday 9 March 2016 at 09:41
To: "user@flink.apache.org<mailto:user@flink.apache.org>" 
<user@flink.apache.org<mailto:user@flink.apache.org>>
Subject: RE: ype of TypeVariable could not be determined

Hi,

The issue is that this problem appears when I want to create a stream source.

StreamExecutionEnvironment.addSource(new MySourceFunction())
…
Where the stream source class is

MySourceFunction implements SourceFunction
{
…
}

In such a case I am not sure how I can pass the outertype  nor how I can pass 
it using the “.returns()” method as Timo suggested



Dr. Radu Tudoran
Research Engineer - Big Data Expert
IT R Division

[cid:image007.jpg@01CD52EB.AD060EE0]
HUAWEI TECHNOLOGIES Duesseldorf GmbH
European Research Center
Riesstrasse 25, 80992 München

E-mail: radu.tudo...@huawei.com<mailto:radu.tudo...@huawei.com>
Mobile: +49 15209084330
Telephone: +49 891588344173

HUAWEI TECHNOLOGIES Duesseldorf GmbH
Hansaallee 205, 40549 Düsseldorf, Germany, 
www.huawei.com<http://www.huawei.com/>
Registered Office: Düsseldorf, Register Court Düsseldorf, HRB 56063,
Managing Director: Bo PENG, Wanzhou MENG, Lifang CHEN
Sitz der Gesellschaft: Düsseldorf, Amtsgericht Düsseldorf, HRB 56063,
Geschäftsführer: Bo PENG, Wanzhou MENG, Lifang CHEN
This e-mail and its attachments contain confidential information from HUAWEI, 
which is intended only for the person or entity whose address is listed above. 
Any use of the information contained herein in any way (including, but not 
limited to, total or partial disclosure, reproduction, or dissemination) by 
persons other than the intended recipient(s) is prohibited. If you receive this 
e-mail in error, please notify the sender by phone or email immediately and 
delete it!

From: Wang Yangjun [mailto:yangjun.w...@aalto.fi]
Sent: Tuesday, March 08, 2016 7:15 PM
To: user@flink.apache.org<mailto:user@flink.apache.org>
Subject: Re: ype of TypeVariable could not be determined

Hi Radu,

I met this issue also. The reason is outTypeInfo couldn't be created base on 
generic type when a transform applied.

public  SingleOutputStreamOperator<R, ?> transform(String operatorName, 
TypeInformation outTypeInfo, OneInputStreamOperator<T, R> operator)
The solution would be passed Calss to your UDF and create TypeInfomation 
by yourself.

Best,
Jun

From: Radu Tudoran <radu.tudo...@huawei.com<mailto:radu.tudo...@huawei.com>>
Reply-To: "user@flink.apache.org<mailto:user@flink.apache.org>" 
<user@flink.apache.org<mailto:user@flink.apache.org>>
Date: Tuesday 8 March 2016 at 19:57
To: "user@flink.apache.org<mailto:user@flink.apache.org>" 
<user@flink.apache.org<mailto:user@flink.apache.org>>
Subject: ype of TypeVariable could not be determined

Hi,

I am trying to create a custom stream source. I first build this with generic 
and I run into problems regarding type extraction. I tried to put concrete 
types but run into the same issue (see errors below). Can anyone provide a 
solution to solve this issue.

Caused by: org.apache.flink.api.common.functions.InvalidTypesException: Type of 
TypeVariable 'IN' in 'class test.MySourceFunction' could not be determined. 
This is most likely a type erasure problem. The type extraction currently 
supports types with generic variables only in cases where all variables in the 
return type can be deduced from the input type(s).
   at 
org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfoWithTypeHierarchy(TypeExtractor.java:498)
   at 
org.apache.flink.api.java.typeutils.TypeExtractor.privateCreateTypeInfo(TypeExtractor.java:380)
   at 
org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfo(TypeExtractor.java:346)
   at 
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.addSource(StreamExecutionEnvironment.java:1152)
   at 
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.addSource(StreamExecutionEnvironment.java:1107)
   at 
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.addSource(StreamExecutionEnvironment.java:1089)
   ... 1 more


Caused by: org.apache.flink.api.common.functions.InvalidTypesException: Type of 
TypeVariable 'TupleEvent2' in 'class test.MySourceFunctionTuple' could not be 
determined. This is most likely a type erasure problem. The type extraction 
currently supports types with generic variables only in cases where all 
variables i

RE: ype of TypeVariable could not be determined

2016-03-08 Thread Radu Tudoran
Hi,

The issue is that this problem appears when I want to create a stream source.

StreamExecutionEnvironment.addSource(new MySourceFunction())
…
Where the stream source class is

MySourceFunction implements SourceFunction
{
…
}

In such a case I am not sure how I can pass the outertype  nor how I can pass 
it using the “.returns()” method as Timo suggested



Dr. Radu Tudoran
Research Engineer - Big Data Expert
IT R Division

[cid:image007.jpg@01CD52EB.AD060EE0]
HUAWEI TECHNOLOGIES Duesseldorf GmbH
European Research Center
Riesstrasse 25, 80992 München

E-mail: radu.tudo...@huawei.com
Mobile: +49 15209084330
Telephone: +49 891588344173

HUAWEI TECHNOLOGIES Duesseldorf GmbH
Hansaallee 205, 40549 Düsseldorf, Germany, 
www.huawei.com<http://www.huawei.com/>
Registered Office: Düsseldorf, Register Court Düsseldorf, HRB 56063,
Managing Director: Bo PENG, Wanzhou MENG, Lifang CHEN
Sitz der Gesellschaft: Düsseldorf, Amtsgericht Düsseldorf, HRB 56063,
Geschäftsführer: Bo PENG, Wanzhou MENG, Lifang CHEN
This e-mail and its attachments contain confidential information from HUAWEI, 
which is intended only for the person or entity whose address is listed above. 
Any use of the information contained herein in any way (including, but not 
limited to, total or partial disclosure, reproduction, or dissemination) by 
persons other than the intended recipient(s) is prohibited. If you receive this 
e-mail in error, please notify the sender by phone or email immediately and 
delete it!

From: Wang Yangjun [mailto:yangjun.w...@aalto.fi]
Sent: Tuesday, March 08, 2016 7:15 PM
To: user@flink.apache.org
Subject: Re: ype of TypeVariable could not be determined

Hi Radu,

I met this issue also. The reason is outTypeInfo couldn't be created base on 
generic type when a transform applied.

public  SingleOutputStreamOperator<R, ?> transform(String operatorName, 
TypeInformation outTypeInfo, OneInputStreamOperator<T, R> operator)
The solution would be passed Calss to your UDF and create TypeInfomation 
by yourself.

Best,
Jun

From: Radu Tudoran <radu.tudo...@huawei.com<mailto:radu.tudo...@huawei.com>>
Reply-To: "user@flink.apache.org<mailto:user@flink.apache.org>" 
<user@flink.apache.org<mailto:user@flink.apache.org>>
Date: Tuesday 8 March 2016 at 19:57
To: "user@flink.apache.org<mailto:user@flink.apache.org>" 
<user@flink.apache.org<mailto:user@flink.apache.org>>
Subject: ype of TypeVariable could not be determined

Hi,

I am trying to create a custom stream source. I first build this with generic 
and I run into problems regarding type extraction. I tried to put concrete 
types but run into the same issue (see errors below). Can anyone provide a 
solution to solve this issue.

Caused by: org.apache.flink.api.common.functions.InvalidTypesException: Type of 
TypeVariable 'IN' in 'class test.MySourceFunction' could not be determined. 
This is most likely a type erasure problem. The type extraction currently 
supports types with generic variables only in cases where all variables in the 
return type can be deduced from the input type(s).
   at 
org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfoWithTypeHierarchy(TypeExtractor.java:498)
   at 
org.apache.flink.api.java.typeutils.TypeExtractor.privateCreateTypeInfo(TypeExtractor.java:380)
   at 
org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfo(TypeExtractor.java:346)
   at 
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.addSource(StreamExecutionEnvironment.java:1152)
   at 
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.addSource(StreamExecutionEnvironment.java:1107)
   at 
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.addSource(StreamExecutionEnvironment.java:1089)
   ... 1 more


Caused by: org.apache.flink.api.common.functions.InvalidTypesException: Type of 
TypeVariable 'TupleEvent2' in 'class test.MySourceFunctionTuple' could not be 
determined. This is most likely a type erasure problem. The type extraction 
currently supports types with generic variables only in cases where all 
variables in the return type can be deduced from the input type(s).
   at 
org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfoWithTypeHierarchy(TypeExtractor.java:498)
   at 
org.apache.flink.api.java.typeutils.TypeExtractor.privateCreateTypeInfo(TypeExtractor.java:380)
   at 
org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfo(TypeExtractor.java:346)
   at 
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.addSource(StreamExecutionEnvironment.java:1152)
   at 
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.addSource(StreamExecutionEnvironment.java:1107)
   at 
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.addSource(StreamExecutionEnvironment.java:1089)
   ... 1 more


Re: ype of TypeVariable could not be determined

2016-03-08 Thread Timo Walther

Hi Radu,

the exception can have multiple causes. It would be great if you could 
share some example code. In most cases the problem is the following:


public class MapFunction { }

new MapFunction();

The type WhatEverType is type erasured by Java. The type must not be 
declared in the "new" call but in the functions signature (IN,OUT) to 
order to be preserved. Alternatively you can pass the type manually by 
using the ".returns()" method or let the function implement the 
"ResultTypeQueryable" interface.


Hope that helps.

Regards,
Timo


On 08.03.2016 18:57, Radu Tudoran wrote:


Hi,

I am trying to create a custom stream source. I first build this with 
generic and I run into problems regarding type extraction. I tried to 
put concrete types but run into the same issue (see errors below). Can 
anyone provide a solution to solve this issue.


Caused by: 
_org.apache.flink.api.common.functions.InvalidTypesException_: Type of 
TypeVariable 'IN' in 'class test.MySourceFunction' could not be 
determined. This is most likely a type erasure problem. The type 
extraction currently supports types with generic variables only in 
cases where all variables in the return type can be deduced from the 
input type(s).


at 
org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfoWithTypeHierarchy(_TypeExtractor.java:498_)


at 
org.apache.flink.api.java.typeutils.TypeExtractor.privateCreateTypeInfo(_TypeExtractor.java:380_)


at 
org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfo(_TypeExtractor.java:346_)


at 
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.addSource(_StreamExecutionEnvironment.java:1152_)


at 
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.addSource(_StreamExecutionEnvironment.java:1107_)


at 
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.addSource(_StreamExecutionEnvironment.java:1089_)


... 1 more

Caused by: 
_org.apache.flink.api.common.functions.InvalidTypesException_: Type of 
TypeVariable 'TupleEvent2' in 'class test.MySourceFunctionTuple' could 
not be determined. This is most likely a type erasure problem. The 
type extraction currently supports types with generic variables only 
in cases where all variables in the return type can be deduced from 
the input type(s).


at 
org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfoWithTypeHierarchy(_TypeExtractor.java:498_)


at 
org.apache.flink.api.java.typeutils.TypeExtractor.privateCreateTypeInfo(_TypeExtractor.java:380_)


at 
org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfo(_TypeExtractor.java:346_)


at 
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.addSource(_StreamExecutionEnvironment.java:1152_)


at 
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.addSource(_StreamExecutionEnvironment.java:1107_)


at 
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.addSource(_StreamExecutionEnvironment.java:1089_)


... 1 more

Dr. Radu Tudoran

Research Engineer - Big Data Expert

IT R Division

cid:image007.jpg@01CD52EB.AD060EE0

HUAWEI TECHNOLOGIES Duesseldorf GmbH

European Research Center

Riesstrasse 25, 80992 München

E-mail: _radu.tudoran@huawei.com_

Mobile: +49 15209084330

Telephone: +49 891588344173

HUAWEI TECHNOLOGIES Duesseldorf GmbH
Hansaallee 205, 40549 Düsseldorf, Germany, www.huawei.com 


Registered Office: Düsseldorf, Register Court Düsseldorf, HRB 56063,
Managing Director: Bo PENG, Wanzhou MENG, Lifang CHEN
Sitz der Gesellschaft: Düsseldorf, Amtsgericht Düsseldorf, HRB 56063,
Geschäftsführer: Bo PENG, Wanzhou MENG, Lifang CHEN

This e-mail and its attachments contain confidential information from 
HUAWEI, which is intended only for the person or entity whose address 
is listed above. Any use of the information contained herein in any 
way (including, but not limited to, total or partial disclosure, 
reproduction, or dissemination) by persons other than the intended 
recipient(s) is prohibited. If you receive this e-mail in error, 
please notify the sender by phone or email immediately and delete it!






Re: ype of TypeVariable could not be determined

2016-03-08 Thread Wang Yangjun
Hi Radu,

I met this issue also. The reason is outTypeInfo couldn't be created base on 
generic type when a transform applied.

public  SingleOutputStreamOperator transform(String operatorName, 
TypeInformation outTypeInfo, OneInputStreamOperator operator)

The solution would be passed Calss to your UDF and create TypeInfomation 
by yourself.

Best,
Jun

From: Radu Tudoran >
Reply-To: "user@flink.apache.org" 
>
Date: Tuesday 8 March 2016 at 19:57
To: "user@flink.apache.org" 
>
Subject: ype of TypeVariable could not be determined

Hi,

I am trying to create a custom stream source. I first build this with generic 
and I run into problems regarding type extraction. I tried to put concrete 
types but run into the same issue (see errors below). Can anyone provide a 
solution to solve this issue.

Caused by: org.apache.flink.api.common.functions.InvalidTypesException: Type of 
TypeVariable 'IN' in 'class test.MySourceFunction' could not be determined. 
This is most likely a type erasure problem. The type extraction currently 
supports types with generic variables only in cases where all variables in the 
return type can be deduced from the input type(s).
   at 
org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfoWithTypeHierarchy(TypeExtractor.java:498)
   at 
org.apache.flink.api.java.typeutils.TypeExtractor.privateCreateTypeInfo(TypeExtractor.java:380)
   at 
org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfo(TypeExtractor.java:346)
   at 
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.addSource(StreamExecutionEnvironment.java:1152)
   at 
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.addSource(StreamExecutionEnvironment.java:1107)
   at 
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.addSource(StreamExecutionEnvironment.java:1089)
   ... 1 more


Caused by: org.apache.flink.api.common.functions.InvalidTypesException: Type of 
TypeVariable 'TupleEvent2' in 'class test.MySourceFunctionTuple' could not be 
determined. This is most likely a type erasure problem. The type extraction 
currently supports types with generic variables only in cases where all 
variables in the return type can be deduced from the input type(s).
   at 
org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfoWithTypeHierarchy(TypeExtractor.java:498)
   at 
org.apache.flink.api.java.typeutils.TypeExtractor.privateCreateTypeInfo(TypeExtractor.java:380)
   at 
org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfo(TypeExtractor.java:346)
   at 
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.addSource(StreamExecutionEnvironment.java:1152)
   at 
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.addSource(StreamExecutionEnvironment.java:1107)
   at 
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.addSource(StreamExecutionEnvironment.java:1089)
   ... 1 more


Dr. Radu Tudoran
Research Engineer - Big Data Expert
IT R Division

[cid:image007.jpg@01CD52EB.AD060EE0]
HUAWEI TECHNOLOGIES Duesseldorf GmbH
European Research Center
Riesstrasse 25, 80992 München

E-mail: radu.tudo...@huawei.com
Mobile: +49 15209084330
Telephone: +49 891588344173

HUAWEI TECHNOLOGIES Duesseldorf GmbH
Hansaallee 205, 40549 Düsseldorf, Germany, 
www.huawei.com
Registered Office: Düsseldorf, Register Court Düsseldorf, HRB 56063,
Managing Director: Bo PENG, Wanzhou MENG, Lifang CHEN
Sitz der Gesellschaft: Düsseldorf, Amtsgericht Düsseldorf, HRB 56063,
Geschäftsführer: Bo PENG, Wanzhou MENG, Lifang CHEN
This e-mail and its attachments contain confidential information from HUAWEI, 
which is intended only for the person or entity whose address is listed above. 
Any use of the information contained herein in any way (including, but not 
limited to, total or partial disclosure, reproduction, or dissemination) by 
persons other than the intended recipient(s) is prohibited. If you receive this 
e-mail in error, please notify the sender by phone or email immediately and 
delete it!