You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Radu Tudoran <ra...@huawei.com> on 2016/10/20 16:15:19 UTC

question for generic streams

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

Re: question for generic streams

Posted by Aljoscha Krettek <al...@apache.org>.
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 <ra...@huawei.com> 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
>