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
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