Hi,
I'd like to know which is more efficient: splitting a stream 3 ways via `split` or via `filter`?
--- FILTER ------
val greater = stream.filter(_.n > 0)
val less = stream.filter(_.n < 0)
val equal = stream.filter(_.n == 0)
-----------------
- VS -
--- SPLIT -------
val split = stream.split(row =>
if (row.n > 0)
List("greater")
else if (row.n < 0)
List("less")
else
List("equal")
)
val greater = split select "greater"
val less = split select "less"
val equal = split select "equal"
-----------------
Thanks!
Lawrence