I have filtered an RDD of Sale objects to get a single Sale by id. But how do I get a Sale object? I've tried mapping to Sale but it also returns an array. As well as
As far as I understand map transformation just returns another RDD and it is expected behavior. Since RDD is an immutable data structure.
val sales: RDD[Sale] = oldSales.filter(sale => sale.ID == "123-0567").map(s => s) val filteredSale: Sale = ??