com.twitter.summingbird.planner
We can always push all Also nodes all the way to the bottom of the dag MergedProducer(AlsoProducer(t, a), b) == AlsoProducer(t, MergedProducer(a, b))
(a.
a.
Combine flatMaps followed by optionMap into a single operation
If you can't optimize KeyFlatMaps, use this
(a ++ b).
If you don't care to distinguish between optionMap and flatMap, you can use this rule
Identity keyed producer is just a trick to make scala see methods on keyed types, they have no meaning at runtime.
Strip all the names.
If you can't optimize ValueFlatMaps, use this
Create an ExpressionDag for the given node.
Create an ExpressionDag for the given node. This should be the final tail of the graph. You can apply optimizations on this Dag and then use the Id returned to evaluate it back to an optimized producer
This makes a potentially unsound cast.
This makes a potentially unsound cast. Since this method is only use in converting from an AlsoProducer to a Literal[T, Prod] below, it is not actually dangerous because we always use it in a safe position.
Optimize the given producer according to the rule
Convert a Producer graph into a Literal in the Dag rewriter This is where the tedious work comes in.