Re: How to perform Broadcast and groupBy in DataStream like DataSet

Posted by stefanobaghino on
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/How-to-perform-Broadcast-and-groupBy-in-DataStream-like-DataSet-tp6644p6655.html

I'm not sure in regards of "withBroadcastSet", but in the DataStream you "keyBy" instead of "groupBy".

On Tue, May 3, 2016 at 12:35 PM, subash basnet <[hidden email]> wrote:
Hello all,

How could we perform withBroadcastSet and groupBy in DataStream like that of DataSet in the below KMeans code:

DataSet<Centroid> newCentroids = points
.map(new SelectNearestCenter()).withBroadcastSet(loop, "centroids")
.map(new CountAppender()).groupBy(0).reduce(new CentroidAccumulator())
.map(new CentroidAverager());


DataStream<Centroid> newCentroids = points.map(new SelectNearestCenter()).???


Best Regards,
Subash Basnet



--
BR,
Stefano Baghino

Software Engineer @ Radicalbit