question for generic streams

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

question for generic streams

Radu Tudoran

Hi,

 

I am trying to read the types of an input stream from a file and then generate the datastream resulting from parsing a source accordingly (e.g. DataStream<TupleN<type1,type2…>>). Finally this will be registered as a table.

What would be the best way to do this?

 

I am trying currently to use the generic type of Tuple for the datastream which then will be instantiated based on the arity of the number of types. However, this does not seem to be a good way (and did not really figure out how to actually implement it)

 

Any suggestions are welcome

Reply | Threaded
Open this post in threaded view
|

Re: question for generic streams

Aljoscha Krettek
Hi,
I think the basic problem here is that the generic types cannot really be changed when executing, i.e. when you read the types of the stream from a file.

One thing I could suggest is to use Strings for everything and inside those Strings use JSON or something similar to encode different types. This might not be a very well performing solution but it is very general.

Cheers,
Aljoscha

On Thu, 20 Oct 2016 at 18:15 Radu Tudoran <[hidden email]> wrote:

Hi,

 

I am trying to read the types of an input stream from a file and then generate the datastream resulting from parsing a source accordingly (e.g. DataStream<TupleN<type1,type2…>>). Finally this will be registered as a table.

What would be the best way to do this?

 

I am trying currently to use the generic type of Tuple for the datastream which then will be instantiated based on the arity of the number of types. However, this does not seem to be a good way (and did not really figure out how to actually implement it)

 

Any suggestions are welcome