public class UnionOptimizer
extends TezOpPlanVisitor
Optimizes union by removing the intermediate union vertex and making the
successor get input from the predecessor vertices directly using VertexGroup.
This should be run after MultiQueryOptimizer so that it handles cases like
union followed by split and then store.
For eg:
1) Union followed by store
Vertex 1 (Load), Vertex 2 (Load) -> Vertex 3 (Union + Store) will be optimized to
Vertex 1 (Load + Store), Vertex 2 (Load + Store). Both the vertices will be writing output
to same store location directly which is supported by Tez.
2) Union followed by groupby
Vertex 1 (Load), Vertex 2 (Load) -> Vertex 3 (Union + POLocalRearrange) -> Vertex 4 (Group by)
will be optimized to Vertex 1 (Load + POLR), Vertex 2 (Load + POLR) -> Vertex 4 (Group by)