There was a similar question before the answer was to use org.apache.flink.api.common.io.OutputFormat to do the conversion.
On Tue, Mar 15, 2016 at 7:48 PM, subash basnet <yasub...@gmail.com> wrote: > Hello all, > > In WikipediaAnalysis.java we get *result *of type *DataStream<Tuple2<String, > Long>>*, > > I would want to convert *result* to *newResult* of type > *DataSet<Tuple1<String>>*, > > So tried the following: > DataSet<Tuple1<String>>newResult = result.map(new getResult()); > > public static final class getResult implements MapFunction<Tuple2<String, > Long>, Tuple1<String>> { > > @Override > public Tuple1<String> map(Tuple2<String, Long> value) { > return new Tuple1<String>(value.f1 + ""); > } > } > > But there is type mismatch, with error as: > *Type mismatch: cannot convert from > SingleOutputStreamOperator<Tuple1<String>> to DataSet<Tuple1<String>>* > > > Best Regards, > Subash Basnet >