Re: How to iterate over DataSet elements without converting it to List

2016-02-18 Thread Judit Fehér
Hi, if you want to iterate through a DataSet you can simply use the map function on the DataSets instead of for loops. In your example you have nested loops, instead of this you can join the two datasets and then perform the map function. It looks like you may want to implement a k-means algorithm

How to iterate over DataSet elements without converting it to List

2016-02-18 Thread subash basnet
Hello there, I have been stuck on how to iterate over the DataSet, perform operations and return a new modified DataSet similar to that of list operation as shown below. Eg: for (Centroid centroid : centroids.collect()) { for (Tuple2 element : clusteredPoints.collect()) { //perform nece