i have a Dataset[(K, V)] i would like to group by k and then reduce V using a function (V, V) => V how do i do this?
i would expect something like: val ds = Dataset[(K, V)] ds.groupBy(_._1).mapValues(_._2).reduce(f) or better: ds.grouped.reduce(f) # grouped only works on Dataset[(_, _)] and i dont care about java api but there is no mapValues or grouped. ds.groupBy(_._1) gives me a GroupedDataset[(K, (K, V))] which is inconvenient. i could carry the key through the reduce operation but that seems ugly and inefficient. any thoughts?