flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Suneel Marthi <smar...@apache.org>
Subject Re: Convert Datastream to Collector or List
Date Wed, 16 Mar 2016 11:50:07 GMT
DataStream<String> ds = .......

Iterator<String> iter = DataStreamUtils.collect(ds);

List<String> list = Lists.newArrayList(iterator);

Hope that helps.

On Wed, Mar 16, 2016 at 7:37 AM, Ahmed Nader <ahmednader839@gmail.com>

> Hi,
> I want to pass an object of type DataStream ,after applying map function
> on it, as a parameter to be used somewhere else. But when i do so, i get an
> error message of trying to access a null context object.
> Is there a way that i can convert this DataStream object to a list or a
> collector so as to be used somewhere else afterwards.
> Thanks,
> Ahmed

View raw message