We actually have map and filter implementations in the untyped cascading DSL of RichPipe, but somehow we never used them in the typed API.
This is a shame because for filter we were hiding them from cascading, and we were boxing all maps into single iterators, which we don't need to do. Lastly, the iteration in the FlatMapFunction we skip since in a map you know there is exactly one.
Finally, I think cascading reuses the tuple with a filter, so there is less allocation. This may also be possible with map, but I'm not 100% clear about it.
closes #1742
We actually have map and filter implementations in the untyped cascading DSL of RichPipe, but somehow we never used them in the typed API.
This is a shame because for filter we were hiding them from cascading, and we were boxing all maps into single iterators, which we don't need to do. Lastly, the iteration in the FlatMapFunction we skip since in a map you know there is exactly one.
Finally, I think cascading reuses the tuple with a filter, so there is less allocation. This may also be possible with map, but I'm not 100% clear about it.